mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 16:43:40 +02:00
Fix editing of cover priorities in metadata download preferences broken
This commit is contained in:
parent
a002f7f465
commit
7ba42499b8
1 changed files with 6 additions and 3 deletions
|
|
@ -58,7 +58,7 @@ def data(self, index, role):
|
|||
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 @@ def setData(self, index, val, role):
|
|||
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…
Reference in a new issue