From 97c5b041a3fcaa2632f42973b278cb1f42e78118 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Wed, 6 Apr 2011 08:11:27 +0100 Subject: [PATCH 1/2] When drag & dropping onto the tag browser, set the current node to the one dropped upon. --- src/calibre/gui2/tag_view.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/calibre/gui2/tag_view.py b/src/calibre/gui2/tag_view.py index f86e261443..73f423981a 100644 --- a/src/calibre/gui2/tag_view.py +++ b/src/calibre/gui2/tag_view.py @@ -985,6 +985,7 @@ class TagsModel(QAbstractItemModel): # {{{ def do_drop_from_library(self, md, action, row, column, parent): idx = parent if idx.isValid(): + self.tags_view.setCurrentIndex(idx) node = self.data(idx, Qt.UserRole) if node.type == TagTreeItem.TAG: fm = self.db.metadata_for_field(node.tag.category) From 086a2959173f56fc27d9d55008dc66c4cba8d0bb Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Wed, 6 Apr 2011 17:56:54 +0100 Subject: [PATCH 2/2] Fix #751950: make content server ignore non-existent search restrictions. --- src/calibre/library/server/base.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/server/base.py b/src/calibre/library/server/base.py index dba6abbfa5..eea28469a9 100644 --- a/src/calibre/library/server/base.py +++ b/src/calibre/library/server/base.py @@ -24,6 +24,8 @@ from calibre.library.server.xml import XMLServer from calibre.library.server.opds import OPDSServer from calibre.library.server.cache import Cache from calibre.library.server.browse import BrowseServer +from calibre.utils.search_query_parser import saved_searches +from calibre import prints class DispatchController(object): # {{{ @@ -178,7 +180,12 @@ class LibraryServer(ContentServer, MobileServer, XMLServer, OPDSServer, Cache, def set_search_restriction(self, restriction): self.search_restriction_name = restriction if restriction: - self.search_restriction = 'search:"%s"'%restriction + if restriction not in saved_searches().names(): + prints('WARNING: Content server: search restriction ', + restriction, ' does not exist') + self.search_restriction = '' + else: + self.search_restriction = 'search:"%s"'%restriction else: self.search_restriction = '' self.reset_caches()