diff --git a/src/Kdb3Database.cpp b/src/Kdb3Database.cpp index beae7bc..8e57bf8 100644 --- a/src/Kdb3Database.cpp +++ b/src/Kdb3Database.cpp @@ -1695,24 +1695,41 @@ QList Kdb3Database::search(IGroupHandle* Group,const QString& sea } else SearchEntries=entries(); - - for(int i=0;i allGroups = groups(); + for (int i=0; iparent()==NULL && allGroups[i]->title()=="Backup"){ + backupGroup = allGroups[i]; + break; + } + } + } + + QList ResultEntries; + for(int i=0; igroup(); + while (entryGroup->parent()) + entryGroup = entryGroup->parent(); + if (entryGroup == backupGroup) + continue; + bool match=false; if(Fields[0])match=match||searchStringContains(search,SearchEntries[i]->title(),CaseSensitive,RegExp); if(Fields[1])match=match||searchStringContains(search,SearchEntries[i]->username(),CaseSensitive,RegExp); if(Fields[2])match=match||searchStringContains(search,SearchEntries[i]->url(),CaseSensitive,RegExp); - SecString Password=SearchEntries[i]->password(); Password.unlock(); + SecString Password=SearchEntries[i]->password(); + Password.unlock(); if(Fields[3])match=match||searchStringContains(search,Password.string(),CaseSensitive,RegExp); Password.lock(); if(Fields[4])match=match||searchStringContains(search,SearchEntries[i]->comment(),CaseSensitive,RegExp); if(Fields[5])match=match||searchStringContains(search,SearchEntries[i]->binaryDesc(),CaseSensitive,RegExp); - if(!match){ - SearchEntries.removeAt(i); - i--; - } + if(match) + ResultEntries << SearchEntries[i]; } - return SearchEntries; + return ResultEntries; } void Kdb3Database::rebuildIndices(QList& list){ diff --git a/src/forms/SettingsDlg.ui b/src/forms/SettingsDlg.ui index 4b05022..b9d8dc2 100644 --- a/src/forms/SettingsDlg.ui +++ b/src/forms/SettingsDlg.ui @@ -451,9 +451,6 @@ 23 - - - true @@ -507,9 +504,6 @@ 23 - - - true diff --git a/src/lib/GroupView.cpp b/src/lib/GroupView.cpp index d8ff099..15a07e5 100644 --- a/src/lib/GroupView.cpp +++ b/src/lib/GroupView.cpp @@ -66,9 +66,9 @@ void KeepassGroupView::updateIcons(){ void KeepassGroupView::showSearchResults(){ if(topLevelItem(topLevelItemCount()-1)!=SearchResultItem){ addTopLevelItem(SearchResultItem); - setCurrentItem(SearchResultItem); } - emit searchResultsSelected(); + setCurrentItem(SearchResultItem); + emit searchResultsSelected(); } void KeepassGroupView::addChilds(GroupViewItem* item){