Fix issues with new stylesheet cache

This commit is contained in:
Florian Bruhin 2017-07-11 21:59:17 +02:00
parent 9307cf86fa
commit ba8083c539
2 changed files with 3 additions and 1 deletions

View File

@ -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)

View File

@ -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))