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
|
return None
|
||||||
col = index.column()
|
col = index.column()
|
||||||
|
|
||||||
if role == Qt.DisplayRole:
|
if role in (Qt.DisplayRole, Qt.EditRole):
|
||||||
if col == 0:
|
if col == 0:
|
||||||
return plugin.name
|
return plugin.name
|
||||||
elif col == 1:
|
elif col == 1:
|
||||||
@ -99,8 +99,11 @@ class SourcesModel(QAbstractTableModel): # {{{
|
|||||||
self.enabled_overrides[plugin] = int(val)
|
self.enabled_overrides[plugin] = int(val)
|
||||||
ret = True
|
ret = True
|
||||||
if col == 1 and role == Qt.EditRole:
|
if col == 1 and role == Qt.EditRole:
|
||||||
self.cover_overrides[plugin] = int(val)
|
try:
|
||||||
ret = True
|
self.cover_overrides[plugin] = max(1, int(val))
|
||||||
|
ret = True
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
pass
|
||||||
if ret:
|
if ret:
|
||||||
self.dataChanged.emit(index, index)
|
self.dataChanged.emit(index, index)
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
x
Reference in New Issue
Block a user