mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
FTS: Fix restrict books working on selected books rather than filtered books
This commit is contained in:
parent
cde3ff211c
commit
9787a710c2
@ -398,7 +398,7 @@ class ResultsView(QTreeView):
|
||||
gui = get_gui()
|
||||
restrict = None
|
||||
if gui and gprefs['fts_library_restrict_books']:
|
||||
restrict = gui.library_view.get_selected_ids(as_set=True)
|
||||
restrict = frozenset(gui.library_view.model().all_current_book_ids())
|
||||
with BusyCursor():
|
||||
self.m.search(*a, restrict_to_book_ids=restrict, use_stemming=gprefs['fts_library_use_stemmer'])
|
||||
self.expandAll()
|
||||
|
@ -585,6 +585,9 @@ class BooksModel(QAbstractTableModel): # {{{
|
||||
return 0
|
||||
return len(self.db.data) if self.db else 0
|
||||
|
||||
def all_current_book_ids(self):
|
||||
return self.db.data._map_filtered
|
||||
|
||||
def count(self):
|
||||
return self.rowCount(None)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user