[PATCH] qtlib: remove unused getpixmap() and _pixmapcache

4 views
Skip to first unread message

Antonio Muci

unread,
May 4, 2026, 5:06:30 PMMay 4
to thg...@googlegroups.com, a....@inwind.it
# HG changeset patch
# User Antonio Muci <a....@inwind.it>
# Date 1777928751 -7200
# Mon May 04 23:05:51 2026 +0200
# Branch stable
# Node ID 97a8698d82fff3c6b87385904998337fb645e964
# Parent c92cd00dbfe34302c6ea6824a2636b28c92adcbc
qtlib: remove unused getpixmap() and _pixmapcache

While trying to debug the slow startup time of TortoiseHg, and in particular
qtlib.geticon() taking a lot of time, I've noted this unused snippet, which was
added on 2010-05-27, in 6d70ca99b9da.

Tempus fugit.

diff --git a/tortoisehg/hgqt/qtlib.py b/tortoisehg/hgqt/qtlib.py
--- a/tortoisehg/hgqt/qtlib.py
+++ b/tortoisehg/hgqt/qtlib.py
@@ -759,17 +759,6 @@ def getoverlaidicon(base: QIcon, overlay
return QIcon(pixmap)


-_pixmapcache: Dict[str, QPixmap] = {}
-
-def getpixmap(name: str, width: int = 16, height: int = 16) -> QPixmap:
- key = '%s_%sx%s' % (name, width, height)
- try:
- return _pixmapcache[key]
- except KeyError:
- pixmap = geticon(name).pixmap(width, height)
- _pixmapcache[key] = pixmap
- return pixmap
-
def getcheckboxpixmap(
state: QStyle.StateFlag,
bgcolor: Union[QColor, Qt.GlobalColor],

Yuya Nishihara

unread,
May 5, 2026, 5:01:43 AMMay 5
to 'Antonio Muci' via TortoiseHg Developers, a....@inwind.it
On Mon, 04 May 2026 23:06:26 +0200, 'Antonio Muci' via TortoiseHg Developers wrote:
> # HG changeset patch
> # User Antonio Muci <a....@inwind.it>
> # Date 1777928751 -7200
> # Mon May 04 23:05:51 2026 +0200
> # Branch stable
> # Node ID 97a8698d82fff3c6b87385904998337fb645e964
> # Parent c92cd00dbfe34302c6ea6824a2636b28c92adcbc
> qtlib: remove unused getpixmap() and _pixmapcache

Queued, thanks.
Reply all
Reply to author
Forward
0 new messages