Skip to content

Commit

Permalink
[processing] Initialize icons before first usage
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Feb 4, 2016
1 parent 7325f5f commit b956886
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py
Expand Up @@ -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(),
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/core/GeoAlgorithm.py
Expand Up @@ -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()

Expand Down Expand Up @@ -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(';')
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/gui/PostgisTableSelector.py
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions python/plugins/processing/modeler/ModelerGraphicItem.py
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/processing/script/ScriptAlgorithm.py
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit b956886

Please sign in to comment.