From ceaf585cfef87229ed473cc857a06b1d83c1826f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 13 Aug 2021 23:51:08 +0530 Subject: [PATCH] Fix #1939912 [In 5.25, "Remove unused CSS" tool options do not do what they say they do anymore](https://bugs.launchpad.net/calibre/+bug/1939912) --- src/calibre/gui2/tweak_book/polish.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/calibre/gui2/tweak_book/polish.py b/src/calibre/gui2/tweak_book/polish.py index 8e70e615b9..7f503c26bf 100644 --- a/src/calibre/gui2/tweak_book/polish.py +++ b/src/calibre/gui2/tweak_book/polish.py @@ -61,10 +61,10 @@ def customize_remove_unused_css(name, parent, ans): 'Merge CSS rules in the same stylesheet that have identical properties.' ' Note that in rare cases merging can result in a change to the effective styling' ' of the book, so use with care.')) - d.p = p = QCheckBox(_('Remove &unreferenced style sheets')) - p.setChecked(tprefs['remove_unreferenced_sheets']) - l.addWidget(p) - d.la4 = label('' + _( + d.u = u = QCheckBox(_('Remove &unreferenced style sheets')) + u.setChecked(tprefs['remove_unreferenced_sheets']) + l.addWidget(u) + d.la5 = label('' + _( 'Remove stylesheets that are not referenced by any content.' )) @@ -76,7 +76,7 @@ def customize_remove_unused_css(name, parent, ans): ans['remove_unused_classes'] = tprefs['remove_unused_classes'] = c.isChecked() ans['merge_identical_selectors'] = tprefs['merge_identical_selectors'] = m.isChecked() ans['merge_rules_with_identical_properties'] = tprefs['merge_rules_with_identical_properties'] = p.isChecked() - ans['remove_unreferenced_sheets'] = tprefs['remove_unreferenced_sheets'] = p.isChecked() + ans['remove_unreferenced_sheets'] = tprefs['remove_unreferenced_sheets'] = u.isChecked() if ret != QDialog.DialogCode.Accepted: raise Abort()