From 57ee4a0fb6dcbb0fe7792251d0a8ca142af06405 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Wed, 10 Apr 2013 08:45:12 +0200 Subject: [PATCH] Prevent creation of empty saved searches --- src/calibre/gui2/search_box.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/calibre/gui2/search_box.py b/src/calibre/gui2/search_box.py index ddcd02cce5..1ae6b23fdb 100644 --- a/src/calibre/gui2/search_box.py +++ b/src/calibre/gui2/search_box.py @@ -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