mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix editing of cover priorities in metadata download preferences broken
This commit is contained in:
parent
a002f7f465
commit
7ba42499b8
@ -58,7 +58,7 @@ class SourcesModel(QAbstractTableModel): # {{{
|
||||
return None
|
||||
col = index.column()
|
||||
|
||||
if role == Qt.DisplayRole:
|
||||
if role in (Qt.DisplayRole, Qt.EditRole):
|
||||
if col == 0:
|
||||
return plugin.name
|
||||
elif col == 1:
|
||||
@ -99,8 +99,11 @@ class SourcesModel(QAbstractTableModel): # {{{
|
||||
self.enabled_overrides[plugin] = int(val)
|
||||
ret = True
|
||||
if col == 1 and role == Qt.EditRole:
|
||||
self.cover_overrides[plugin] = int(val)
|
||||
ret = True
|
||||
try:
|
||||
self.cover_overrides[plugin] = max(1, int(val))
|
||||
ret = True
|
||||
except (ValueError, TypeError):
|
||||
pass
|
||||
if ret:
|
||||
self.dataChanged.emit(index, index)
|
||||
return ret
|
||||
|
Loading…
x
Reference in New Issue
Block a user