Skip to content
Permalink
Browse files

[processing] Initialize icons before first usage

  • Loading branch information
m-kuhn committed Feb 4, 2016
1 parent 7325f5f commit b956886e819c8c6929c327e92d9d5e09174da0cb
@@ -141,10 +141,10 @@

class QGISAlgorithmProvider(AlgorithmProvider):

_icon = QIcon(os.path.join(pluginPath, 'images', 'qgis.png'))

def __init__(self):
AlgorithmProvider.__init__(self)
self._icon = QIcon(os.path.join(pluginPath, 'images', 'qgis.png'))

self.alglist = [SumLines(), PointsInPolygon(),
PointsInPolygonWeighted(), PointsInPolygonUnique(),
BasicStatisticsStrings(), BasicStatisticsNumbers(),
@@ -48,9 +48,8 @@

class GeoAlgorithm:

_icon = QIcon(os.path.dirname(__file__) + '/../images/alg.png')

def __init__(self):
self._icon = QIcon(os.path.dirname(__file__) + '/../images/alg.png')
# Parameters needed by the algorithm
self.parameters = list()

@@ -219,7 +218,8 @@ def execute(self, progress=None, model=None):

def _checkParameterValuesBeforeExecuting(self):
for param in self.parameters:
if isinstance(param, (ParameterRaster, ParameterVector, ParameterMultipleInput)):
if isinstance(param, (ParameterRaster, ParameterVector,
ParameterMultipleInput)):
if param.value:
if isinstance(param, ParameterMultipleInput):
inputlayers = param.value.split(';')
@@ -85,10 +85,10 @@ def okPressed(self):

class ConnectionItem(QtGui.QTreeWidgetItem):

connIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/postgis.png')
schemaIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/namespace.png')

def __init__(self, connection):
self.connIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/postgis.png')
self.schemaIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/namespace.png')

QtGui.QTreeWidgetItem.__init__(self)
self.setChildIndicatorPolicy(QtGui.QTreeWidgetItem.ShowIndicator)
self.connection = connection
@@ -383,10 +383,10 @@ class FoldButtonGraphicItem(FlatButtonGraphicItem):
WIDTH = 11
HEIGHT = 11

icons = {True: QIcon(os.path.join(pluginPath, 'images', 'plus.png')),
False: QIcon(os.path.join(pluginPath, 'images', 'minus.png'))}

def __init__(self, position, action, folded):
self.icons = {True: QIcon(os.path.join(pluginPath, 'images', 'plus.png')),
False: QIcon(os.path.join(pluginPath, 'images', 'minus.png'))}

self.folded = folded
icon = self.icons[self.folded]
super(FoldButtonGraphicItem, self).__init__(icon, position, action)
@@ -58,8 +58,6 @@

class ScriptAlgorithm(GeoAlgorithm):

_icon = QtGui.QIcon(os.path.join(pluginPath, 'images', 'script.png'))

def __init__(self, descriptionFile, script=None):
"""The script parameter can be used to directly pass the code
of the script without a file.
@@ -69,6 +67,8 @@ def __init__(self, descriptionFile, script=None):
"""

GeoAlgorithm.__init__(self)
self._icon = QtGui.QIcon(os.path.join(pluginPath, 'images', 'script.png'))

self.script = script
self.allowEdit = True
self.noCRSWarning = False

0 comments on commit b956886

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