Skip to content
Permalink
Browse files

[processing][saga] Allow saga algorithms to be run under SAGA 7.3,

but show a huge obnoxious "NOT OFFICIALLY SUPPORTED" warning

SAGA 7.3 is the new SAGA LTR, so we eventually need to move towards this.

But adding full support is going to be a painstaking tedious process. So
allow users to use this combination, but totally at their own risk.

TODO: Make SAGA provider a 3rd party plugin only and save QGIS core dev sanity ;)
(cherry picked from commit d969e41)
  • Loading branch information
nyalldawson committed Dec 5, 2019
1 parent d6afeb6 commit d7144ea9f47f4dbe7b44788dd540f9be707d6f55
Showing with 9 additions and 2 deletions.
  1. +9 −2 python/plugins/processing/algs/saga/SagaAlgorithmProvider.py
@@ -40,6 +40,7 @@
os.path.split(os.path.dirname(__file__))[0], os.pardir))

REQUIRED_VERSION = '2.3.'
BETA_SUPPORT_VERSION = '7.3.'


class SagaAlgorithmProvider(QgsProcessingProvider):
@@ -78,18 +79,24 @@ def setActive(self, active):

def canBeActivated(self):
version = SagaUtils.getInstalledVersion(True)
if version is not None and version.startswith(REQUIRED_VERSION):
if version is not None and (version.startswith(REQUIRED_VERSION) or version.startswith(BETA_SUPPORT_VERSION)):
return True
return False

def warningMessage(self):
version = SagaUtils.getInstalledVersion(True)
if version is not None and version.startswith(BETA_SUPPORT_VERSION):
return self.tr('SAGA version {} is not officially supported - algorithms may encounter issues').format(version)
return ''

def loadAlgorithms(self):
version = SagaUtils.getInstalledVersion(True)
if version is None:
QgsMessageLog.logMessage(self.tr('Problem with SAGA installation: SAGA was not found or is not correctly installed'),
self.tr('Processing'), Qgis.Critical)
return

if not version.startswith(REQUIRED_VERSION):
if not version.startswith(REQUIRED_VERSION) and not version.startswith(BETA_SUPPORT_VERSION):
QgsMessageLog.logMessage(self.tr('Problem with SAGA installation: unsupported SAGA version (found: {}, required: {}).').format(version, REQUIRED_VERSION),
self.tr('Processing'),
Qgis.Critical)

0 comments on commit d7144ea

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