mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
[processing] add icon caching for other providers
This commit is contained in:
parent
d03d2069b9
commit
cc62c52269
@ -41,8 +41,14 @@ pluginPath = os.path.normpath(os.path.join(
|
||||
|
||||
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 @@ class OTBAlgorithm(GeoAlgorithm):
|
||||
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 @@ class OTBAlgorithm(GeoAlgorithm):
|
||||
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.tools.system import isWindows
|
||||
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 @@ class RAlgorithm(GeoAlgorithm):
|
||||
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,6 +72,7 @@ class SagaAlgorithm212(GeoAlgorithm):
|
||||
self.allowUnmatchingGridExtents = False
|
||||
self.descriptionFile = descriptionfile
|
||||
self.defineCharacteristicsFromFile()
|
||||
self._icon = None
|
||||
|
||||
def getCopy(self):
|
||||
newone = SagaAlgorithm212(self.descriptionFile)
|
||||
@ -79,7 +80,9 @@ class SagaAlgorithm212(GeoAlgorithm):
|
||||
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,6 +59,7 @@ class TauDEMAlgorithm(GeoAlgorithm):
|
||||
GeoAlgorithm.__init__(self)
|
||||
self.descriptionFile = descriptionfile
|
||||
self.defineCharacteristicsFromFile()
|
||||
self._icon = None
|
||||
|
||||
def getCopy(self):
|
||||
newone = TauDEMAlgorithm(self.descriptionFile)
|
||||
@ -66,7 +67,9 @@ class TauDEMAlgorithm(GeoAlgorithm):
|
||||
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user