mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit Book: Fix extra search being hidden when removing a saved search
This commit is contained in:
parent
b79417e1d7
commit
7c85a0deda
@ -541,15 +541,11 @@ class SearchesModel(QAbstractListModel):
|
|||||||
self.endResetModel()
|
self.endResetModel()
|
||||||
|
|
||||||
def remove_searches(self, rows):
|
def remove_searches(self, rows):
|
||||||
rows = sorted(set(rows), reverse=True)
|
indices = {self.filtered_searches[row] for row in frozenset(rows)}
|
||||||
indices = [self.filtered_searches[row] for row in rows]
|
|
||||||
for row in rows:
|
|
||||||
self.beginRemoveRows(QModelIndex(), row, row)
|
|
||||||
del self.filtered_searches[row]
|
|
||||||
self.endRemoveRows()
|
|
||||||
for idx in sorted(indices, reverse=True):
|
for idx in sorted(indices, reverse=True):
|
||||||
del self.searches[idx]
|
del self.searches[idx]
|
||||||
tprefs['saved_searches'] = self.searches
|
tprefs['saved_searches'] = self.searches
|
||||||
|
self.do_filter('')
|
||||||
|
|
||||||
class EditSearch(QFrame): # {{{
|
class EditSearch(QFrame): # {{{
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user