From 0e6c2ab4132bb92c0cdd1a5e996f785125ac5dd4 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Wed, 11 Sep 2019 11:50:32 -0700 Subject: [PATCH] icons: avoid memoization for icon paths The icon paths might incur unicode serialization, so avoid the issue by not memoizing icons. There performance difference is minimal. Resolves: #991 Reported-by: Aleksey @akontsevich on github.com Signed-off-by: David Aguilar --- cola/icons.py | 3 --- share/doc/git-cola/relnotes.rst | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cola/icons.py b/cola/icons.py index 9f4bffd70..b17266681 100644 --- a/cola/icons.py +++ b/cola/icons.py @@ -10,7 +10,6 @@ from . import qtcompat from . import resources from .compat import ustr -from .decorators import memoize from .i18n import N_ @@ -67,7 +66,6 @@ def name_from_basename(basename): return 'icons:' + basename -@memoize def from_name(name): """Return a QIcon from an absolute filename or "icons:basename.svg" name""" return QtGui.QIcon(name) @@ -78,7 +76,6 @@ def icon(basename): return from_name(name_from_basename(basename)) -@memoize def from_theme(name, fallback=None): """Grab an icon from the current theme with a fallback diff --git a/share/doc/git-cola/relnotes.rst b/share/doc/git-cola/relnotes.rst index 212024d4a..199c3abca 100644 --- a/share/doc/git-cola/relnotes.rst +++ b/share/doc/git-cola/relnotes.rst @@ -60,6 +60,7 @@ Fixes * Better unicode robustness. (`#990 `_) + (`#910 `_) * The "Branches" widget did not always update itself when deleting branches (for example, when inotify is disabled or unavailable).