Fix: Crash when moving entry to another group (Bug #2644545)
git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@277 b624d157-de02-0410-bad0-e51aec6abb33
This commit is contained in:
parent
13df3a6c72
commit
5944e2620f
|
@ -220,7 +220,6 @@ void CEditEntryDlg::OnButtonOK()
|
||||||
if(Combo_Group->currentIndex()!=GroupIndex){
|
if(Combo_Group->currentIndex()!=GroupIndex){
|
||||||
db->moveEntry(entry,groups[Combo_Group->currentIndex()]);
|
db->moveEntry(entry,groups[Combo_Group->currentIndex()]);
|
||||||
EntryMoved=true;
|
EntryMoved=true;
|
||||||
ModFlag=true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(EntryMoved)
|
if(EntryMoved)
|
||||||
|
|
|
@ -216,9 +216,10 @@ void KeepassEntryView::updateEntry(EntryViewItem* item){
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeepassEntryView::editEntry(EntryViewItem* item){
|
void KeepassEntryView::editEntry(EntryViewItem* item){
|
||||||
CEntry old = item->EntryHandle->data();
|
IEntryHandle* handle = item->EntryHandle;
|
||||||
|
CEntry old = handle->data();
|
||||||
|
|
||||||
CEditEntryDlg dlg(db,item->EntryHandle,this,true);
|
CEditEntryDlg dlg(db,handle,this,true);
|
||||||
int result = dlg.exec();
|
int result = dlg.exec();
|
||||||
switch(result){
|
switch(result){
|
||||||
case 0: //canceled or no changes
|
case 0: //canceled or no changes
|
||||||
|
@ -230,14 +231,14 @@ void KeepassEntryView::editEntry(EntryViewItem* item){
|
||||||
//entry moved to another group
|
//entry moved to another group
|
||||||
case 2: //modified
|
case 2: //modified
|
||||||
case 3: //not modified
|
case 3: //not modified
|
||||||
|
Items.removeOne(item);
|
||||||
delete item;
|
delete item;
|
||||||
Items.removeAt(Items.indexOf(item));
|
|
||||||
emit fileModified();
|
emit fileModified();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
IGroupHandle* bGroup;
|
IGroupHandle* bGroup;
|
||||||
if ((result==1 || result==2) && config->backup() && item->EntryHandle->group() != (bGroup=db->backupGroup())){
|
if ((result==1 || result==2) && config->backup() && handle->group() != (bGroup=db->backupGroup())){
|
||||||
old.LastAccess = QDateTime::currentDateTime();
|
old.LastAccess = QDateTime::currentDateTime();
|
||||||
old.LastMod = old.LastAccess;
|
old.LastMod = old.LastAccess;
|
||||||
if (bGroup==NULL)
|
if (bGroup==NULL)
|
||||||
|
|
Loading…
Reference in New Issue