Fix error when trying to add the first icon rule to the Tag browser. Fixes #2125438 [cannot set value icon rules](https://bugs.launchpad.net/calibre/+bug/2125438)

This commit is contained in:
Kovid Goyal 2025-09-23 07:02:43 +05:30
parent 98b6a0e175
commit e1c702e26b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -556,8 +556,8 @@ class TbIconRulesTab(LazyConfigWidgetBase, Ui_Form):
for cat in tuple(c for c in cats if c.startswith('@')): # user categories
cats.pop(cat, None)
all_values = {cat: {t.name for t in cats[cat]} for cat in cats.keys()}
for category,vdict in gprefs['tags_browser_value_icons'].items():
self.all_values = all_values = {cat: {t.name for t in cats[cat]} for cat in cats.keys()}
for category, vdict in gprefs['tags_browser_value_icons'].items():
if category in field_metadata:
if category not in all_values: # can this happen? Perhaps because of GIGO
all_values[category] = set()
@ -571,7 +571,6 @@ class TbIconRulesTab(LazyConfigWidgetBase, Ui_Form):
continue
else:
all_values[category] = set()
self.all_values = all_values
with block_signals(self.rules_table):
for item_value in vdict:
if (only_current_library and item_value != TEMPLATE_ICON_INDICATOR and