Skip to content
Permalink
Browse files

[processing] add icon caching for other providers

  • Loading branch information
alexbruy committed Oct 4, 2016
1 parent d03d206 commit cc62c5226951c813a4c3a61744b51827aa5d3afa
@@ -41,8 +41,14 @@

class GdalAlgorithm(GeoAlgorithm):

def __init__(self):
GeoAlgorithm.__init__(self)
self._icon = None

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

def getCustomParametersDialog(self):
return GdalAlgorithmDialog(self)
@@ -67,6 +67,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)
@@ -77,7 +78,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()
@@ -61,6 +61,9 @@
from processing.script.WrongScriptException import WrongScriptException
from .RUtils import RUtils

pluginPath = os.path.normpath(os.path.join(
os.path.split(os.path.dirname(__file__))[0], os.pardir))


class RAlgorithm(GeoAlgorithm):

@@ -80,9 +83,12 @@ def __init__(self, descriptionFile, script=None):
self.defineCharacteristicsFromScript()
if descriptionFile is not None:
self.defineCharacteristicsFromFile()
self._icon = None

def getIcon(self):
return QIcon(os.path.dirname(__file__) + '/../../images/r.svg')
if self._icon is None:
self._icon = QIcon(os.path.join(pluginPath, 'images', 'r.svg'))
return self._icon

def defineCharacteristicsFromScript(self):
lines = self.script.split('\n')
@@ -72,14 +72,17 @@ def __init__(self, descriptionfile):
self.allowUnmatchingGridExtents = False
self.descriptionFile = descriptionfile
self.defineCharacteristicsFromFile()
self._icon = None

def getCopy(self):
newone = SagaAlgorithm212(self.descriptionFile)
newone.provider = self.provider
return newone

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

def defineCharacteristicsFromFile(self):
lines = open(self.descriptionFile)
@@ -59,14 +59,17 @@ def __init__(self, descriptionfile):
GeoAlgorithm.__init__(self)
self.descriptionFile = descriptionfile
self.defineCharacteristicsFromFile()
self._icon = None

def getCopy(self):
newone = TauDEMAlgorithm(self.descriptionFile)
newone.provider = self.provider
return newone

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

def defineCharacteristicsFromFile(self):
with codecs.open(self.descriptionFile, encoding='utf-8') as f:

0 comments on commit cc62c52

Please sign in to comment.
You can’t perform that action at this time.