Skip to content
Permalink
Browse files

[processing]fixed SAGA when using a version newer than the latest sup…

…ported one

fixes #13279
  • Loading branch information
volaya committed Oct 1, 2015
1 parent d4cb346 commit a9dab06a6ada0595802e2dcacbe5835f3d957a37
Showing with 6 additions and 5 deletions.
  1. +6 −5 python/plugins/processing/algs/saga/SagaAlgorithmProvider.py
@@ -87,8 +87,9 @@ def _loadAlgorithms(self):
self.tr('Problem with SAGA installation: SAGA was not found or is not correctly installed'))
return
if version not in self.supportedVersions:
if version > self.supportedVersions.keys()[-1]:
version = self.supportedVersions.keys()[-1]
lastVersion = sorted(self.supportedVersions.keys())[-1]
if version > lastVersion:
version = lastVersion
else:
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
self.tr('Problem with SAGA installation: installed SAGA version (%s) is not supported' % version))
@@ -99,12 +100,12 @@ def _loadAlgorithms(self):
for descriptionFile in os.listdir(folder):
if descriptionFile.endswith('txt'):
f = os.path.join(folder, descriptionFile)
self._loadAlgorithm(f)
self._loadAlgorithm(f, version)
self.algs.append(SplitRGBBands())

def _loadAlgorithm(self, descriptionFile):
def _loadAlgorithm(self, descriptionFile, version):
try:
alg = self.supportedVersions[SagaUtils.getSagaInstalledVersion()][1](descriptionFile)
alg = self.supportedVersions[version][1](descriptionFile)
if alg.name.strip() != '':
self.algs.append(alg)
else:

0 comments on commit a9dab06

Please sign in to comment.
You can’t perform that action at this time.