mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
Swallow index errors in the saved searches model as one user reports that they happen
This commit is contained in:
parent
85e0882bbf
commit
7c77e5d21c
@ -395,6 +395,7 @@ class SearchesModel(QAbstractListModel):
|
||||
return len(self.filtered_searches)
|
||||
|
||||
def data(self, index, role):
|
||||
try:
|
||||
if role == Qt.DisplayRole:
|
||||
search = self.searches[self.filtered_searches[index.row()]]
|
||||
return QVariant(search['name'])
|
||||
@ -405,6 +406,8 @@ class SearchesModel(QAbstractListModel):
|
||||
if role == Qt.UserRole:
|
||||
search = self.searches[self.filtered_searches[index.row()]]
|
||||
return QVariant((self.filtered_searches[index.row()], search))
|
||||
except IndexError:
|
||||
pass
|
||||
return NONE
|
||||
|
||||
def do_filter(self, text):
|
||||
|
Loading…
x
Reference in New Issue
Block a user