mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-10-31 10:37:00 -04:00 
			
		
		
		
	Merge branch 'master' of https://github.com/cbhaley/calibre into master
Fixes #1897432 [[Enhancement] Delete entries in the Manage Saved searches screen using the Delete key](https://bugs.launchpad.net/calibre/+bug/1897432) Fixes #1897356 [Exclusion searches for user categories are unreliable in Calibre 4.23](https://bugs.launchpad.net/calibre/+bug/1897356)
This commit is contained in:
		
						commit
						8586cb8d9a
					
				| @ -141,6 +141,12 @@ class SavedSearchEditor(Dialog): | ||||
|             if ans in self.searches: | ||||
|                 return ans | ||||
| 
 | ||||
|     def keyPressEvent(self, ev): | ||||
|         if ev.key() == Qt.Key_Delete: | ||||
|             self.del_search() | ||||
|             return | ||||
|         return Dialog.keyPressEvent(self, ev) | ||||
| 
 | ||||
|     def populate_search_list(self): | ||||
|         self.slist.clear() | ||||
|         for name in sorted(self.searches.keys(), key=sort_key): | ||||
|  | ||||
| @ -127,6 +127,7 @@ class TagBrowserMixin(object):  # {{{ | ||||
|         user_cats[new_cat] = [] | ||||
|         db.new_api.set_pref('user_categories', user_cats) | ||||
|         self.tags_view.recount() | ||||
|         db.new_api.clear_search_caches() | ||||
|         m = self.tags_view.model() | ||||
|         idx = m.index_for_path(m.find_category_node('@' + new_cat)) | ||||
|         self.tags_view.show_item_at_index(idx) | ||||
| @ -148,6 +149,7 @@ class TagBrowserMixin(object):  # {{{ | ||||
|             db.new_api.set_pref('user_categories', d.categories) | ||||
|             db.new_api.refresh_search_locations() | ||||
|             self.tags_view.recount() | ||||
|             db.new_api.clear_search_caches() | ||||
|             self.user_categories_edited() | ||||
| 
 | ||||
|     def do_delete_user_category(self, category_name): | ||||
| @ -182,6 +184,7 @@ class TagBrowserMixin(object):  # {{{ | ||||
|                 del user_cats[k] | ||||
|         db.new_api.set_pref('user_categories', user_cats) | ||||
|         self.tags_view.recount() | ||||
|         db.new_api.clear_search_caches() | ||||
|         self.user_categories_edited() | ||||
| 
 | ||||
|     def do_del_item_from_user_cat(self, user_cat, item_name, item_category): | ||||
| @ -201,6 +204,7 @@ class TagBrowserMixin(object):  # {{{ | ||||
|         self.tags_view.model().delete_item_from_user_category(user_cat, | ||||
|                                                       item_name, item_category) | ||||
|         self.tags_view.recount() | ||||
|         db.new_api.clear_search_caches() | ||||
|         self.user_categories_edited() | ||||
| 
 | ||||
|     def do_add_item_to_user_cat(self, dest_category, src_name, src_category): | ||||
| @ -229,6 +233,7 @@ class TagBrowserMixin(object):  # {{{ | ||||
|             user_cats[dest_category].append([src_name, src_category, 0]) | ||||
|         db.new_api.set_pref('user_categories', user_cats) | ||||
|         self.tags_view.recount() | ||||
|         db.new_api.clear_search_caches() | ||||
|         self.user_categories_edited() | ||||
| 
 | ||||
|     def get_book_ids(self, use_virtual_library, db, category): | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user