Lower tabbar cache bound and clean up code
This commit is contained in:
parent
49daa7aab8
commit
cb6f4313d7
@ -463,13 +463,13 @@ class TabBar(QTabBar):
|
|||||||
icon_width,
|
icon_width,
|
||||||
ellipsis)
|
ellipsis)
|
||||||
|
|
||||||
@functools.lru_cache(maxsize=2**10)
|
@functools.lru_cache(maxsize=2**9)
|
||||||
def _minimum_tab_size_hint_helper(self, tab_text: str,
|
def _minimum_tab_size_hint_helper(self, tab_text: str,
|
||||||
icon_width: int,
|
icon_width: int,
|
||||||
ellipsis: bool) -> QSize:
|
ellipsis: bool) -> QSize:
|
||||||
"""Helper function to cache tab results.
|
"""Helper function to cache tab results.
|
||||||
|
|
||||||
Acessing config values in here should be added to _on_config_changed to
|
Config values accessed in here should be added to _on_config_changed to
|
||||||
ensure cache is flushed when needed.
|
ensure cache is flushed when needed.
|
||||||
"""
|
"""
|
||||||
text = '\u2026' if ellipsis else tab_text
|
text = '\u2026' if ellipsis else tab_text
|
||||||
|
@ -171,6 +171,7 @@ def debug_cache_stats():
|
|||||||
prefix_info = configdata.is_valid_prefix.cache_info()
|
prefix_info = configdata.is_valid_prefix.cache_info()
|
||||||
# pylint: disable=protected-access
|
# pylint: disable=protected-access
|
||||||
render_stylesheet_info = config._render_stylesheet.cache_info()
|
render_stylesheet_info = config._render_stylesheet.cache_info()
|
||||||
|
# pylint: enable=protected-access
|
||||||
|
|
||||||
history_info = None
|
history_info = None
|
||||||
try:
|
try:
|
||||||
@ -183,8 +184,10 @@ def debug_cache_stats():
|
|||||||
|
|
||||||
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
tabbed_browser = objreg.get('tabbed-browser', scope='window',
|
||||||
window='last-focused')
|
window='last-focused')
|
||||||
|
# pylint: disable=protected-access
|
||||||
tabbed_browser_info = tabbed_browser.tabBar(). \
|
tabbed_browser_info = tabbed_browser.tabBar(). \
|
||||||
_minimum_tab_size_hint_helper.cache_info()
|
_minimum_tab_size_hint_helper.cache_info()
|
||||||
|
# pylint: enable=protected-access
|
||||||
|
|
||||||
log.misc.debug('is_valid_prefix: {}'.format(prefix_info))
|
log.misc.debug('is_valid_prefix: {}'.format(prefix_info))
|
||||||
log.misc.debug('_render_stylesheet: {}'.format(render_stylesheet_info))
|
log.misc.debug('_render_stylesheet: {}'.format(render_stylesheet_info))
|
||||||
|
Loading…
Reference in New Issue
Block a user