some work on the search function

git-svn-id: https://svn.code.sf.net/p/keepassx/code/trunk@33 b624d157-de02-0410-bad0-e51aec6abb33
master
tariq 18 years ago
parent 7a343cc30b
commit befd8d5631
  1. 12
      src/mainwindow.cpp
  2. 1
      src/mainwindow.h

@ -477,12 +477,24 @@ void KeepassMainWindow::OnEditDeleteEntry(){
Q_ASSERT(EntryView->selectedItems().size()>0);
QList<QTreeWidgetItem*> entries=EntryView->selectedItems();
for(int i=0; i<entries.size();i++){
removeFromSearchResults(((EntryViewItem*)entries[i])->pEntry->sID);
db->deleteEntry(((EntryViewItem*)entries[i])->pEntry);
}
setStateFileModified(true);
EntryView->updateItems();
}
void KeepassMainWindow::removeFromSearchResults(int id){
for(int i=0; i<SearchResults.size();i++){
if(SearchResults[i]==id){
SearchResults.removeAt(i);
return;
}
}
}
void KeepassMainWindow::OnEditUsernameToClipboard(){
Clipboard->setText(currentEntry()->UserName, QClipboard::Clipboard);
ClipboardTimer.start(config.ClipboardTimeOut*1000,true);

@ -100,6 +100,7 @@ private:
bool closeDatabase();
void search(CGroup* pGroup);
void editEntry(CEntry* pEntry);
void removeFromSearchResults(int sID);
inline CGroup* currentGroup();
inline CEntry* currentEntry();