summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base/rbsettings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/base/rbsettings.cpp')
-rw-r--r--rbutil/rbutilqt/base/rbsettings.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/rbutil/rbutilqt/base/rbsettings.cpp b/rbutil/rbutilqt/base/rbsettings.cpp
index 98d5b331b7..37f01c6c1c 100644
--- a/rbutil/rbutilqt/base/rbsettings.cpp
+++ b/rbutil/rbutilqt/base/rbsettings.cpp
@@ -165,16 +165,19 @@ void RbSettings::setSubValue(QString sub, enum UserSettings setting, QVariant va
QString RbSettings::constructSettingPath(QString path, QString substitute)
{
- QString platform = userSettings->value("platform").toString();
- if(!substitute.isEmpty()) {
- path.replace(":tts:", substitute);
- path.replace(":encoder:", substitute);
- }
- else {
- path.replace(":tts:", userSettings->value("tts").toString());
- path.replace(":encoder:", SystemInfo::platformValue(platform,SystemInfo::CurEncoder).toString());
+ // anything to substitute?
+ if(path.contains(':')) {
+ QString platform = userSettings->value("platform").toString();
+ if(!substitute.isEmpty()) {
+ path.replace(":tts:", substitute);
+ path.replace(":encoder:", substitute);
+ }
+ else {
+ path.replace(":tts:", userSettings->value("tts").toString());
+ path.replace(":encoder:", SystemInfo::platformValue(platform,SystemInfo::CurEncoder).toString());
+ }
+ path.replace(":platform:", platform);
}
- path.replace(":platform:", platform);
return path;
}