Skip to content

Commit ea9b09f

Browse files
DelazJnyalldawson
authored andcommitted
Use QGIS user manual for GDAL algorithms help files
because they are available for most of the algs and wouldn't be used otherwise. Also when someone hits algA help button, he should be given the algA help and not the main gdal utility doc.
1 parent 309920a commit ea9b09f

File tree

3 files changed

+4
-38
lines changed

3 files changed

+4
-38
lines changed

python/plugins/processing/algs/gdal/GdalAlgorithm.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,6 @@ def processAlgorithm(self, parameters, context, feedback):
142142

143143
return results
144144

145-
def helpUrl(self):
146-
helpPath = GdalUtils.gdalHelpPath()
147-
if helpPath == '':
148-
return None
149-
150-
if os.path.exists(helpPath):
151-
return QUrl.fromLocalFile(os.path.join(helpPath, '{}.html'.format(self.commandName()))).toString()
152-
else:
153-
return helpPath + '{}.html'.format(self.commandName())
154-
155145
def commandName(self):
156146
parameters = {}
157147
for param in self.parameterDefinitions():

python/plugins/processing/algs/gdal/GdalAlgorithmProvider.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,12 @@ def load(self):
103103
ProcessingConfig.settingIcons[self.name()] = self.icon()
104104
ProcessingConfig.addSetting(Setting(self.name(), 'ACTIVATE_GDAL',
105105
self.tr('Activate'), True))
106-
ProcessingConfig.addSetting(Setting(
107-
self.name(),
108-
GdalUtils.GDAL_HELP_PATH,
109-
self.tr('Location of GDAL docs'),
110-
GdalUtils.gdalHelpPath()))
111106
ProcessingConfig.readSettings()
112107
self.refreshAlgorithms()
113108
return True
114109

115110
def unload(self):
116111
ProcessingConfig.removeSetting('ACTIVATE_GDAL')
117-
ProcessingConfig.removeSetting(GdalUtils.GDAL_HELP_PATH)
118112

119113
def isActive(self):
120114
return ProcessingConfig.getSetting('ACTIVATE_GDAL')

python/plugins/processing/algs/gdal/GdalUtils.py

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -157,10 +157,10 @@ def getSupportedRasters():
157157
if extensions:
158158
GdalUtils.supportedRasters[shortName] = extensions
159159
# Only creatable rasters can be referenced in output rasters
160-
if ((gdal.DCAP_CREATE in metadata
161-
and metadata[gdal.DCAP_CREATE] == 'YES')
162-
or (gdal.DCAP_CREATECOPY in metadata
163-
and metadata[gdal.DCAP_CREATECOPY] == 'YES')):
160+
if ((gdal.DCAP_CREATE in metadata and
161+
metadata[gdal.DCAP_CREATE] == 'YES') or
162+
(gdal.DCAP_CREATECOPY in metadata and
163+
metadata[gdal.DCAP_CREATECOPY] == 'YES')):
164164
GdalUtils.supportedOutputRasters[shortName] = extensions
165165

166166
return GdalUtils.supportedRasters
@@ -240,24 +240,6 @@ def version():
240240
def readableVersion():
241241
return gdal.VersionInfo('RELEASE_NAME')
242242

243-
@staticmethod
244-
def gdalHelpPath():
245-
helpPath = ProcessingConfig.getSetting(GdalUtils.GDAL_HELP_PATH)
246-
247-
if helpPath is None:
248-
if isWindows():
249-
pass
250-
elif isMac():
251-
pass
252-
else:
253-
searchPaths = ['/usr/share/doc/libgdal-doc/gdal']
254-
for path in searchPaths:
255-
if os.path.exists(path):
256-
helpPath = os.path.abspath(path)
257-
break
258-
259-
return helpPath if helpPath is not None else 'http://www.gdal.org/'
260-
261243
@staticmethod
262244
def ogrConnectionStringFromLayer(layer):
263245
"""Generates OGR connection string from a layer

0 commit comments

Comments
 (0)