Changeset 8b97b4597c61…
Parent d8dcf12f72ae…
by
Changes to one file · Browse files at 8b97b4597c61 Showing diff from parent d8dcf12f72ae Diff from another changeset...
@@ -152,18 +152,19 @@ Return a QIcon for the resource named 'name.(svg|png)' (the given
'name' parameter must *not* provide the extension).
"""
+ def findicon(name):
+ for ext in ('svg', 'png', 'ico'):
+ path = ':/icons/%s.%s' % (name, ext)
+ if QtCore.QFile.exists(path):
+ return QtGui.QIcon(path)
+
+ return QtGui.QIcon(':/icons/fallback.svg')
+
try:
return _iconcache[name]
except KeyError:
- for ext in ('svg', 'png', 'ico'):
- path = ':/icons/%s.%s' % (name, ext)
- if QtCore.QFile.exists(path):
- icon = QtGui.QIcon(path)
- break
- else:
- icon = QtGui.QIcon(':/icons/fallback.svg')
- _iconcache[name] = icon
- return icon
+ _iconcache[name] = findicon(name)
+ return _iconcache[name]
_pixmapcache = {}
|
Loading...