Skip to content

Commit 5617dbc

Browse files
committed
Revert "[processing] cache icons to speed up toolbox rendering"
This reverts commit d265f33. Was causing failure on Travis
1 parent 26d7235 commit 5617dbc

File tree

4 files changed

+12
-16
lines changed

4 files changed

+12
-16
lines changed

python/plugins/processing/algs/grass/GrassAlgorithm.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
pluginPath = os.path.normpath(os.path.join(
6767
os.path.split(os.path.dirname(__file__))[0], os.pardir))
6868

69-
_icon = QIcon(os.path.join(pluginPath, 'images', 'grass.svg'))
7069

7170
class GrassAlgorithm(GeoAlgorithm):
7271

@@ -90,10 +89,9 @@ def getCopy(self):
9089
newone = GrassAlgorithm(self.descriptionFile)
9190
newone.provider = self.provider
9291
return newone
93-
92+
9493
def getIcon(self):
95-
return _icon
96-
94+
return QIcon(os.path.join(pluginPath, 'images', 'grass.svg'))
9795

9896
def help(self):
9997
return False, 'http://grass.osgeo.org/grass64/manuals/' + self.grassName + '.html'
@@ -123,10 +121,11 @@ def defineCharacteristicsFromFile(self):
123121
line = lines.readline().strip('\n').strip()
124122
self.grassName = line
125123
line = lines.readline().strip('\n').strip()
126-
self.name = line.split("-")[0]
127-
#self.i18n_name = QCoreApplication.translate("GrassAlgorithm", self.name)
128-
self.name = self.grassName
129-
self.i18n_name = self.grassName
124+
self.name = line
125+
self.i18n_name = QCoreApplication.translate("GrassAlgorithm", line)
126+
if " - " not in self.name:
127+
self.name = self.grassName + " - " + self.name
128+
self.i18n_name = self.grassName + " - " + self.i18n_name
130129
line = lines.readline().strip('\n').strip()
131130
self.group = line
132131
self.i18n_group = QCoreApplication.translate("GrassAlgorithm", line)

python/plugins/processing/algs/grass7/Grass7Algorithm.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
pluginPath = os.path.normpath(os.path.join(
6666
os.path.split(os.path.dirname(__file__))[0], os.pardir))
6767

68-
_icon = QIcon(os.path.join(pluginPath, 'images', 'grass.svg'))
6968

7069
class Grass7Algorithm(GeoAlgorithm):
7170

@@ -99,8 +98,8 @@ def getCopy(self):
9998
return newone
10099

101100
def getIcon(self):
102-
return _icon
103-
101+
return QIcon(os.path.join(pluginPath, 'images', 'grass.svg'))
102+
104103
def help(self):
105104
localDoc = None
106105
html = self.grass7Name + '.html'

python/plugins/processing/algs/otb/OTBAlgorithm.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
pluginPath = os.path.normpath(os.path.join(
5252
os.path.split(os.path.dirname(__file__))[0], os.pardir))
5353

54-
_icon = QIcon(os.path.join(pluginPath, 'images', 'otb.png'))
5554

5655
class OTBAlgorithm(GeoAlgorithm):
5756

@@ -74,7 +73,7 @@ def getCopy(self):
7473
return newone
7574

7675
def getIcon(self):
77-
return _icon
76+
return QIcon(os.path.join(pluginPath, 'images', 'otb.png'))
7877

7978
def help(self):
8079
version = OTBUtils.getInstalledVersion()

python/plugins/processing/algs/saga/SagaAlgorithm212.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757

5858
sessionExportedLayers = {}
5959

60-
_icon = QIcon(os.path.join(pluginPath, 'images', 'saga.png'))
6160

6261
class SagaAlgorithm212(GeoAlgorithm):
6362

@@ -76,8 +75,8 @@ def getCopy(self):
7675
return newone
7776

7877
def getIcon(self):
79-
return _icon
80-
78+
return QIcon(os.path.join(pluginPath, 'images', 'saga.png'))
79+
8180
def defineCharacteristicsFromFile(self):
8281
lines = open(self.descriptionFile)
8382
line = lines.readline().strip('\n').strip()

0 commit comments

Comments
 (0)