summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Kamat <jaygkamat@gmail.com>2017-10-24 10:18:10 -0400
committerFlorian Bruhin <git@the-compiler.org>2017-10-31 07:06:55 +0100
commit9a2d451bc53a92f9e4d1287b305c28dc4f20ed9d (patch)
tree42718c2ab2e87f8a088b870e219bc6fcc795c385
parent5a080ebea56e5add9814026e516833a61cb0159f (diff)
downloadqutebrowser-9a2d451bc53a92f9e4d1287b305c28dc4f20ed9d.tar.gz
qutebrowser-9a2d451bc53a92f9e4d1287b305c28dc4f20ed9d.zip
Lower tabbar cache bound and clean up code
(cherry picked from commit cb6f4313d7e74d1cf8ab7152958b617fad34c882)
-rw-r--r--qutebrowser/mainwindow/tabwidget.py4
-rw-r--r--qutebrowser/misc/utilcmds.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/qutebrowser/mainwindow/tabwidget.py b/qutebrowser/mainwindow/tabwidget.py
index 1eda2d405..6a3448495 100644
--- a/qutebrowser/mainwindow/tabwidget.py
+++ b/qutebrowser/mainwindow/tabwidget.py
@@ -450,13 +450,13 @@ class TabBar(QTabBar):
icon_width,
ellipsis)
- @functools.lru_cache(maxsize=2**10)
+ @functools.lru_cache(maxsize=2**9)
def _minimum_tab_size_hint_helper(self, tab_text: str,
icon_width: int,
ellipsis: bool) -> QSize:
"""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.
"""
text = '\u2026' if ellipsis else tab_text
diff --git a/qutebrowser/misc/utilcmds.py b/qutebrowser/misc/utilcmds.py
index e4c4fc033..07949b771 100644
--- a/qutebrowser/misc/utilcmds.py
+++ b/qutebrowser/misc/utilcmds.py
@@ -171,6 +171,7 @@ def debug_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
history_info = None
try:
@@ -183,8 +184,10 @@ def debug_cache_stats():
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window='last-focused')
+ # pylint: disable=protected-access
tabbed_browser_info = tabbed_browser.tabBar(). \
_minimum_tab_size_hint_helper.cache_info()
+ # pylint: enable=protected-access
log.misc.debug('is_valid_prefix: {}'.format(prefix_info))
log.misc.debug('_render_stylesheet: {}'.format(render_stylesheet_info))