}
// Edit an existing tag
@SuppressWarnings("unused")
private void editSavedSearch() {
logger.log(logger.HIGH, "Entering NeverNote.editSavedSearch");
SavedSearchEdit edit = new SavedSearchEdit();
edit.setTitle(tr("Edit Search"));
List<QTreeWidgetItem> selections = savedSearchTree.selectedItems();
QTreeWidgetItem currentSelection;
currentSelection = selections.get(0);
String guid = currentSelection.text(1);
SavedSearch s = conn.getSavedSearchTable().getSavedSearch(guid);
edit.setName(currentSelection.text(0));
edit.setQuery(s.getQuery());
edit.setSearchList(listManager.getSavedSearchIndex());
edit.exec();
if (!edit.okPressed())
return;
List<SavedSearch> list = listManager.getSavedSearchIndex();
SavedSearch search = null;
boolean found = false;
for (int i=0; i<list.size(); i++) {
search = list.get(i);
if (search.getGuid().equals(guid)) {
i=list.size();
found = true;
}
}
if (!found)
return;
search.setName(edit.getName());
search.setQuery(edit.getQuery());
conn.getSavedSearchTable().updateSavedSearch(search, true);
savedSearchIndexUpdated();
logger.log(logger.HIGH, "Leaving NeverNote.editSavedSearch");
}