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 19 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); Q_ASSERT(EntryView->selectedItems().size()>0);
QList<QTreeWidgetItem*> entries=EntryView->selectedItems(); QList<QTreeWidgetItem*> entries=EntryView->selectedItems();
for(int i=0; i<entries.size();i++){ for(int i=0; i<entries.size();i++){
removeFromSearchResults(((EntryViewItem*)entries[i])->pEntry->sID);
db->deleteEntry(((EntryViewItem*)entries[i])->pEntry); db->deleteEntry(((EntryViewItem*)entries[i])->pEntry);
} }
setStateFileModified(true); setStateFileModified(true);
EntryView->updateItems(); 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(){ void KeepassMainWindow::OnEditUsernameToClipboard(){
Clipboard->setText(currentEntry()->UserName, QClipboard::Clipboard); Clipboard->setText(currentEntry()->UserName, QClipboard::Clipboard);
ClipboardTimer.start(config.ClipboardTimeOut*1000,true); ClipboardTimer.start(config.ClipboardTimeOut*1000,true);

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