Skip to content

Commit cc92107

Browse files
authoredFeb 1, 2018
Merge pull request #6244 from alexbruy/processing-cleanup
[processing] remove unused icons and use SVG icon for Heatmap algorithm
2 parents 3ab6e5c + 55759a4 commit cc92107

File tree

11 files changed

+7
-9
lines changed

11 files changed

+7
-9
lines changed
 

‎images/images.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
<file>themes/default/grass_mapset_open.png</file>
123123
<file>themes/default/grass_mapset_search.png</file>
124124
<file>themes/default/histogram.svg</file>
125+
<file>themes/default/heatmap.svg</file>
125126
<file>themes/default/join_bevel.svg</file>
126127
<file>themes/default/join_miter.svg</file>
127128
<file>themes/default/join_round.svg</file>

‎python/plugins/processing/ProcessingPlugin.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
__revision__ = '$Format:%H$'
2727

2828
import shutil
29-
import inspect
3029
import os
3130
import sys
3231

@@ -55,9 +54,7 @@
5554
from processing.gui.menus import removeMenus, initializeMenus, createMenus
5655
from processing.core.ProcessingResults import resultsList
5756

58-
cmd_folder = os.path.split(inspect.getfile(inspect.currentframe()))[0]
59-
if cmd_folder not in sys.path:
60-
sys.path.insert(0, cmd_folder)
57+
pluginPath = os.path.dirname(__file__)
6158

6259

6360
class ProcessingOptionsFactory(QgsOptionsWidgetFactory):
@@ -208,7 +205,7 @@ def initGui(self):
208205
self.menu.addAction(self.modelerAction)
209206

210207
self.historyAction = QAction(
211-
QIcon(os.path.join(cmd_folder, 'images', 'history.svg')),
208+
QIcon(os.path.join(pluginPath, 'images', 'history.svg')),
212209
self.tr('&History...'), self.iface.mainWindow())
213210
self.historyAction.setObjectName('historyAction')
214211
self.historyAction.triggered.connect(self.openHistory)

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030

3131
from qgis.PyQt.QtGui import QIcon
3232

33-
from qgis.core import (QgsFeatureRequest,
33+
from qgis.core import (QgsApplication,
34+
QgsFeatureRequest,
3435
QgsRasterFileWriter,
3536
QgsProcessing,
3637
QgsProcessingException,
@@ -61,7 +62,7 @@ class Heatmap(QgisAlgorithm):
6162
OUTPUT = 'OUTPUT'
6263

6364
def icon(self):
64-
return QIcon(os.path.join(pluginPath, 'images', 'heatmap.png'))
65+
return QgsApplication.getThemeIcon("/heatmap.svg")
6566

6667
def tags(self):
6768
return self.tr('heatmap,kde,hotspot').split(',')

‎python/plugins/processing/images/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FILE(GLOB IMAGE_FILES *.png *.gif *.svg)
1+
FILE(GLOB IMAGE_FILES *.png *.svg)
22

33
ADD_SUBDIRECTORY(ftools)
44
ADD_SUBDIRECTORY(gdaltools)

‎python/plugins/processing/images/commander.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.
-1.42 KB
Binary file not shown.
-1.24 KB
Binary file not shown.
-741 Bytes
Binary file not shown.
-5.26 KB
Binary file not shown.
-12.7 KB
Binary file not shown.
-598 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)
Please sign in to comment.