Skip to content

Commit 62d1531

Browse files
committedMay 24, 2017
[processing] cache OTB icon to speed up toolbox loading
(partially cherry-picked from cc62c52)
1 parent 5ae723b commit 62d1531

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎python/plugins/processing/algs/otb/OTBAlgorithm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def __init__(self, descriptionfile):
6363
self.defineCharacteristicsFromFile()
6464
self.numExportedLayers = 0
6565
self.hasROI = None
66+
self._icon = None
6667

6768
def __str__(self):
6869
return("Algo : " + self.name + " from app : " + self.cliName + " in : " + self.group)
@@ -73,7 +74,9 @@ def getCopy(self):
7374
return newone
7475

7576
def getIcon(self):
76-
return QIcon(os.path.join(pluginPath, 'images', 'otb.png'))
77+
if self._icon is None:
78+
self._icon = QIcon(os.path.join(pluginPath, 'images', 'otb.png'))
79+
return self._icon
7780

7881
def help(self):
7982
version = OTBUtils.getInstalledVersion()

0 commit comments

Comments
 (0)