summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-01-29 22:46:40 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-01-29 22:46:40 +0000
commit423927310882669e70f318688945bd4e51a847f7 (patch)
treed952917d794f454aed31bbce34f84883801a0785
parent64ead78a9f6a491511cf247c48e6c42521f5acb3 (diff)
downloadrockbox-423927310882669e70f318688945bd4e51a847f7.tar.gz
rockbox-423927310882669e70f318688945bd4e51a847f7.zip
Minimize unnecessary accesses to SystemInfo and RbSettings.
With the separation of the SystemInfo values accessing all the values will create traces, making them rather noisy due to unnecessary multiple accesses. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24373 a1c6a512-1295-4272-9138-f99709370657
-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);
}