From ba8083c539d8cd38960a8d545db83917f4070b76 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 11 Jul 2017 21:59:17 +0200 Subject: [PATCH] Fix issues with new stylesheet cache --- qutebrowser/config/config.py | 2 +- qutebrowser/misc/utilcmds.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 97c536dc3..049f0898b 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -374,6 +374,7 @@ class Config(QObject): def __init__(self, yaml_config, parent=None): super().__init__(parent) + self.changed.connect(_render_stylesheet.cache_clear) self._values = {} self._mutables = [] self._yaml = yaml_config @@ -619,7 +620,6 @@ def init(parent=None): val = ConfigContainer(instance) key_instance = KeyConfig(instance) - instance.changed.connect(_render_stylesheet.cache_clear) configtypes.Font.monospace_fonts = val.fonts.monospace config_commands = ConfigCommands(instance, key_instance) diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py index 10caa4cfb..160bc701c 100644 --- a/qutebrowser/misc/utilcmds.py +++ b/qutebrowser/misc/utilcmds.py @@ -169,7 +169,9 @@ def debug_all_objects(): def debug_cache_stats(): """Print LRU cache stats.""" prefix_info = configdata.is_valid_prefix.cache_info() + # pylint: disable=protected-access render_stylesheet_info = config._render_stylesheet.cache_info() + # pylint: enable=protected-access log.misc.debug('is_valid_prefix: {}'.format(prefix_info)) log.misc.debug('_render_stylesheet: {}'.format(render_stylesheet_info))