Skip to content

Commit

Permalink
[processing] cache OTB icon to speed up toolbox loading
Browse files Browse the repository at this point in the history
(partially cherry-picked from cc62c52)
  • Loading branch information
alexbruy committed May 24, 2017
1 parent 5ae723b commit 62d1531
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion python/plugins/processing/algs/otb/OTBAlgorithm.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def __init__(self, descriptionfile):
self.defineCharacteristicsFromFile()
self.numExportedLayers = 0
self.hasROI = None
self._icon = None

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

def getIcon(self):
return QIcon(os.path.join(pluginPath, 'images', 'otb.png'))
if self._icon is None:
self._icon = QIcon(os.path.join(pluginPath, 'images', 'otb.png'))
return self._icon

def help(self):
version = OTBUtils.getInstalledVersion()
Expand Down

0 comments on commit 62d1531

Please sign in to comment.