Skip to content

Commit b956886

Browse files
committedFeb 4, 2016
[processing] Initialize icons before first usage
1 parent 7325f5f commit b956886

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed
 

‎python/plugins/processing/algs/qgis/QGISAlgorithmProvider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@
141141

142142
class QGISAlgorithmProvider(AlgorithmProvider):
143143

144-
_icon = QIcon(os.path.join(pluginPath, 'images', 'qgis.png'))
145-
146144
def __init__(self):
147145
AlgorithmProvider.__init__(self)
146+
self._icon = QIcon(os.path.join(pluginPath, 'images', 'qgis.png'))
147+
148148
self.alglist = [SumLines(), PointsInPolygon(),
149149
PointsInPolygonWeighted(), PointsInPolygonUnique(),
150150
BasicStatisticsStrings(), BasicStatisticsNumbers(),

‎python/plugins/processing/core/GeoAlgorithm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@
4848

4949
class GeoAlgorithm:
5050

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

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

220219
def _checkParameterValuesBeforeExecuting(self):
221220
for param in self.parameters:
222-
if isinstance(param, (ParameterRaster, ParameterVector, ParameterMultipleInput)):
221+
if isinstance(param, (ParameterRaster, ParameterVector,
222+
ParameterMultipleInput)):
223223
if param.value:
224224
if isinstance(param, ParameterMultipleInput):
225225
inputlayers = param.value.split(';')

‎python/plugins/processing/gui/PostgisTableSelector.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ def okPressed(self):
8585

8686
class ConnectionItem(QtGui.QTreeWidgetItem):
8787

88-
connIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/postgis.png')
89-
schemaIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/namespace.png')
90-
9188
def __init__(self, connection):
89+
self.connIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/postgis.png')
90+
self.schemaIcon = QtGui.QIcon(os.path.dirname(__file__) + '/../images/namespace.png')
91+
9292
QtGui.QTreeWidgetItem.__init__(self)
9393
self.setChildIndicatorPolicy(QtGui.QTreeWidgetItem.ShowIndicator)
9494
self.connection = connection

‎python/plugins/processing/modeler/ModelerGraphicItem.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,10 @@ class FoldButtonGraphicItem(FlatButtonGraphicItem):
383383
WIDTH = 11
384384
HEIGHT = 11
385385

386-
icons = {True: QIcon(os.path.join(pluginPath, 'images', 'plus.png')),
387-
False: QIcon(os.path.join(pluginPath, 'images', 'minus.png'))}
388-
389386
def __init__(self, position, action, folded):
387+
self.icons = {True: QIcon(os.path.join(pluginPath, 'images', 'plus.png')),
388+
False: QIcon(os.path.join(pluginPath, 'images', 'minus.png'))}
389+
390390
self.folded = folded
391391
icon = self.icons[self.folded]
392392
super(FoldButtonGraphicItem, self).__init__(icon, position, action)

‎python/plugins/processing/script/ScriptAlgorithm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858

5959
class ScriptAlgorithm(GeoAlgorithm):
6060

61-
_icon = QtGui.QIcon(os.path.join(pluginPath, 'images', 'script.png'))
62-
6361
def __init__(self, descriptionFile, script=None):
6462
"""The script parameter can be used to directly pass the code
6563
of the script without a file.
@@ -69,6 +67,8 @@ def __init__(self, descriptionFile, script=None):
6967
"""
7068

7169
GeoAlgorithm.__init__(self)
70+
self._icon = QtGui.QIcon(os.path.join(pluginPath, 'images', 'script.png'))
71+
7272
self.script = script
7373
self.allowEdit = True
7474
self.noCRSWarning = False

0 commit comments

Comments
 (0)
Please sign in to comment.