forked from len0rd/rockbox
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
This commit is contained in:
parent
64ead78a9f
commit
4239273108
2 changed files with 16 additions and 13 deletions
|
|
@ -165,16 +165,19 @@ void RbSettings::setSubValue(QString sub, enum UserSettings setting, QVariant va
|
||||||
|
|
||||||
QString RbSettings::constructSettingPath(QString path, QString substitute)
|
QString RbSettings::constructSettingPath(QString path, QString substitute)
|
||||||
{
|
{
|
||||||
QString platform = userSettings->value("platform").toString();
|
// anything to substitute?
|
||||||
if(!substitute.isEmpty()) {
|
if(path.contains(':')) {
|
||||||
path.replace(":tts:", substitute);
|
QString platform = userSettings->value("platform").toString();
|
||||||
path.replace(":encoder:", substitute);
|
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);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
path.replace(":tts:", userSettings->value("tts").toString());
|
|
||||||
path.replace(":encoder:", SystemInfo::platformValue(platform,SystemInfo::CurEncoder).toString());
|
|
||||||
}
|
|
||||||
path.replace(":platform:", platform);
|
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,12 +81,12 @@ QVariant SystemInfo::value(enum SystemInfos info)
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while(SystemInfosList[i].info != info)
|
while(SystemInfosList[i].info != info)
|
||||||
i++;
|
i++;
|
||||||
|
QString platform = RbSettings::value(RbSettings::CurrentPlatform).toString();
|
||||||
QString s = SystemInfosList[i].name;
|
QString s = SystemInfosList[i].name;
|
||||||
s.replace(":platform:", RbSettings::value(RbSettings::CurrentPlatform).toString());
|
s.replace(":platform:", platform);
|
||||||
QString d = SystemInfosList[i].def;
|
QString d = SystemInfosList[i].def;
|
||||||
d.replace(":platform:", RbSettings::value(RbSettings::CurrentPlatform).toString());
|
d.replace(":platform:", platform);
|
||||||
qDebug() << "[SystemInfos] GET:" << s << systemInfos->value(s, d).toString();
|
qDebug() << "[SystemInfo] GET:" << s << systemInfos->value(s, d).toString();
|
||||||
return systemInfos->value(s, d);
|
return systemInfos->value(s, d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue