mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix publisher combobox not being cleared before initializing
This commit is contained in:
parent
f6d0ef1814
commit
fb8fc927cf
@ -988,13 +988,13 @@ class PublisherEdit(MultiCompleteComboBox): # {{{
|
|||||||
all_publishers.sort(key=lambda x : sort_key(x[1]))
|
all_publishers.sort(key=lambda x : sort_key(x[1]))
|
||||||
self.update_items_cache([x[1] for x in all_publishers])
|
self.update_items_cache([x[1] for x in all_publishers])
|
||||||
publisher_id = db.publisher_id(id_, index_is_id=True)
|
publisher_id = db.publisher_id(id_, index_is_id=True)
|
||||||
idx, c = None, 0
|
idx = None
|
||||||
for i in all_publishers:
|
self.clear()
|
||||||
id, name = i
|
for i, x in enumerate(all_publishers):
|
||||||
if id == publisher_id:
|
id_, name = x
|
||||||
idx = c
|
if id_ == publisher_id:
|
||||||
|
idx = i
|
||||||
self.addItem(name)
|
self.addItem(name)
|
||||||
c += 1
|
|
||||||
|
|
||||||
self.setEditText('')
|
self.setEditText('')
|
||||||
if idx is not None:
|
if idx is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user