From e1c702e26bb3632146cd162b8ea052196fab3a31 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 23 Sep 2025 07:02:43 +0530 Subject: [PATCH] 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) --- src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py b/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py index 40d1b7c105..2534505cea 100644 --- a/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py +++ b/src/calibre/gui2/preferences/look_feel_tabs/tb_icon_rules.py @@ -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