mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Rename an icon rule when the value is renamed in the tag browser.
This commit is contained in:
parent
7a48a1ad3f
commit
55a168b57e
@ -1611,6 +1611,11 @@ class TagsModel(QAbstractItemModel): # {{{
|
|||||||
self.db.new_api.rename_items(lookup_key, {an_item.tag.id: new_name},
|
self.db.new_api.rename_items(lookup_key, {an_item.tag.id: new_name},
|
||||||
restrict_to_book_ids=restrict_to_books)
|
restrict_to_book_ids=restrict_to_books)
|
||||||
self.tag_item_renamed.emit()
|
self.tag_item_renamed.emit()
|
||||||
|
val_icon_data = self.value_icons.get(an_item.tag.category, {}).get(an_item.tag.original_name)
|
||||||
|
if val_icon_data:
|
||||||
|
# There is an icon for the old value. Rename it
|
||||||
|
self.value_icons[an_item.tag.category].pop(an_item.tag.original_name, None)
|
||||||
|
self.value_icons[an_item.tag.category][new_name] = val_icon_data
|
||||||
an_item.tag.name = new_name
|
an_item.tag.name = new_name
|
||||||
an_item.tag.state = TAG_SEARCH_STATES['clear']
|
an_item.tag.state = TAG_SEARCH_STATES['clear']
|
||||||
self.use_position_based_index_on_next_recount = True
|
self.use_position_based_index_on_next_recount = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user