Skip to content

Commit 716b17d

Browse files
committed
Always enable OTB settings modification
1 parent 02cd0f0 commit 716b17d

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

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

+8-10
Original file line numberDiff line numberDiff line change
@@ -86,16 +86,14 @@ def _loadAlgorithms(self):
8686

8787
def initializeSettings(self):
8888
AlgorithmProvider.initializeSettings(self)
89-
if OTBUtils.findOtbPath() is None:
90-
ProcessingConfig.addSetting(Setting(self.getDescription(),
91-
OTBUtils.OTB_FOLDER,
92-
self.tr("OTB command line tools folder"), OTBUtils.otbPath(),
93-
valuetype=Setting.FOLDER))
94-
if OTBUtils.findOtbLibPath() is None:
95-
ProcessingConfig.addSetting(Setting(self.getDescription(),
96-
OTBUtils.OTB_LIB_FOLDER,
97-
self.tr("OTB applications folder"), OTBUtils.otbLibPath(),
98-
valuetype=Setting.FOLDER))
89+
ProcessingConfig.addSetting(Setting(self.getDescription(),
90+
OTBUtils.OTB_FOLDER,
91+
self.tr("OTB command line tools folder"), OTBUtils.findOtbPath(),
92+
valuetype=Setting.FOLDER))
93+
ProcessingConfig.addSetting(Setting(self.getDescription(),
94+
OTBUtils.OTB_LIB_FOLDER,
95+
self.tr("OTB applications folder"), OTBUtils.findOtbLibPath(),
96+
valuetype=Setting.FOLDER))
9997
ProcessingConfig.addSetting(Setting(self.getDescription(),
10098
OTBUtils.OTB_SRTM_FOLDER,
10199
self.tr("SRTM tiles folder"), OTBUtils.otbSRTMPath(),

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050

5151
def findOtbPath():
52-
folder = None
52+
folder = ""
5353
#try to configure the path automatically
5454
if isMac():
5555
testfolder = os.path.join(unicode(QgsApplication.prefixPath()), "bin")
@@ -72,14 +72,14 @@ def findOtbPath():
7272

7373

7474
def otbPath():
75-
folder = findOtbPath()
75+
folder = ProcessingConfig.getSetting(OTB_FOLDER)
7676
if folder is None:
77-
folder = ProcessingConfig.getSetting(OTB_FOLDER)
77+
folder = ""
7878
return folder
7979

8080

8181
def findOtbLibPath():
82-
folder = None
82+
folder = ""
8383
#try to configure the path automatically
8484
if isMac():
8585
testfolder = os.path.join(unicode(QgsApplication.prefixPath()), "lib/otb/applications")
@@ -101,9 +101,9 @@ def findOtbLibPath():
101101

102102

103103
def otbLibPath():
104-
folder = findOtbLibPath()
104+
folder = ProcessingConfig.getSetting(OTB_LIB_FOLDER)
105105
if folder is None:
106-
folder = ProcessingConfig.getSetting(OTB_LIB_FOLDER)
106+
folder = ""
107107
return folder
108108

109109

0 commit comments

Comments
 (0)