summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r--rbutil/rbutilqt/base/rbsettings.cpp21
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp8
2 files changed, 16 insertions, 13 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;
}
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index c6b6d83450..3760901c15 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -81,12 +81,12 @@ QVariant SystemInfo::value(enum SystemInfos info)
int i = 0;
while(SystemInfosList[i].info != info)
i++;
-
+ QString platform = RbSettings::value(RbSettings::CurrentPlatform).toString();
QString s = SystemInfosList[i].name;
- s.replace(":platform:", RbSettings::value(RbSettings::CurrentPlatform).toString());
+ s.replace(":platform:", platform);
QString d = SystemInfosList[i].def;
- d.replace(":platform:", RbSettings::value(RbSettings::CurrentPlatform).toString());
- qDebug() << "[SystemInfos] GET:" << s << systemInfos->value(s, d).toString();
+ d.replace(":platform:", platform);
+ qDebug() << "[SystemInfo] GET:" << s << systemInfos->value(s, d).toString();
return systemInfos->value(s, d);
}