Prevent creation of empty saved searches

This commit is contained in:
Charles Haley 2013-04-10 08:45:12 +02:00
parent 4f6ec55b2e
commit 57ee4a0fb6

View File

@ -332,6 +332,10 @@ class SavedSearchBox(QComboBox): # {{{
name = unicode(self.currentText())
if not name.strip():
name = unicode(self.search_box.text()).replace('"', '')
if not (name and self.search_box.text()):
error_dialog(self, _('Create saved search'),
_('There is no search to save'), show=True)
return
saved_searches().delete(name)
saved_searches().add(name, unicode(self.search_box.text()))
# now go through an initialization cycle to ensure that the combobox has