summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-01-21 17:50:47 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-01-21 17:50:47 +0000
commit329ea014e8270ff3d7fd48f3cc8601cf6a322fe1 (patch)
treef1c3451a22a5b4edbcd2d6c0205162218c9f22e8
parentb1dfdd4c7aa713ed5a5433011cff0beca3c7e050 (diff)
downloadrockbox-329ea014e8270ff3d7fd48f3cc8601cf6a322fe1.tar.gz
rockbox-329ea014e8270ff3d7fd48f3cc8601cf6a322fe1.tar.bz2
rockbox-329ea014e8270ff3d7fd48f3cc8601cf6a322fe1.zip
Store server info in RbSettings volatile in a QMap instead of putting it into the user settings.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24312 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--rbutil/rbutilqt/base/rbsettings.cpp20
-rw-r--r--rbutil/rbutilqt/base/rbsettings.h2
2 files changed, 8 insertions, 14 deletions
diff --git a/rbutil/rbutilqt/base/rbsettings.cpp b/rbutil/rbutilqt/base/rbsettings.cpp
index 527312b108..6039f9558e 100644
--- a/rbutil/rbutilqt/base/rbsettings.cpp
+++ b/rbutil/rbutilqt/base/rbsettings.cpp
@@ -111,7 +111,7 @@ const static struct {
//! pointer to setting object to NULL
QSettings* RbSettings::systemSettings = NULL;
QSettings* RbSettings::userSettings = NULL;
-QSettings* RbSettings::serverSettings = NULL;
+QMap<QString, QVariant> RbSettings::serverSettings;
void RbSettings::ensureRbSettingsExists()
{
@@ -122,12 +122,6 @@ void RbSettings::ensureRbSettingsExists()
systemSettings = new QSettings(":/ini/rbutil.ini", QSettings::IniFormat, 0);
}
- if(serverSettings == NULL)
- {
- serverSettings = new QSettings(QSettings::IniFormat,
- QSettings::UserScope, "rockbox.org", "RockboxUtility",NULL);
- }
-
if(userSettings == NULL)
{
// portable installation:
@@ -231,8 +225,8 @@ QVariant RbSettings::value(enum ServerSettings setting)
i++;
QString s = constructSettingPath(ServerSettingsList[i].name);
- qDebug() << "[Settings] GET SERV:" << s << serverSettings->value(s, ServerSettingsList[i].def).toString();
- return serverSettings->value(s, ServerSettingsList[i].def);
+ qDebug() << "[Settings] GET SERV:" << s << serverSettings.value(s, ServerSettingsList[i].def).toString();
+ return serverSettings.value(s);
}
void RbSettings::setValue(enum UserSettings setting , QVariant value)
@@ -257,8 +251,8 @@ void RbSettings::setSubValue(QString sub, enum UserSettings setting, QVariant va
void RbSettings::setValue(enum ServerSettings setting, QVariant value)
{
- QString empty;
- return setPlatformValue(empty, setting, value);
+ QString empty;
+ return setPlatformValue(empty, setting, value);
}
void RbSettings::setPlatformValue(QString platform, enum ServerSettings setting, QVariant value)
@@ -272,8 +266,8 @@ void RbSettings::setPlatformValue(QString platform, enum ServerSettings setting,
QString s = ServerSettingsList[i].name;
s.replace(":platform:", platform);
- serverSettings->setValue(s, value);
- qDebug() << "[Settings] SET SERV:" << s << serverSettings->value(s).toString();
+ serverSettings.insert(s, value);
+ qDebug() << "[Settings] SET SERV:" << s << serverSettings.value(s).toString();
}
diff --git a/rbutil/rbutilqt/base/rbsettings.h b/rbutil/rbutilqt/base/rbsettings.h
index 5e128e602d..b7327b19cb 100644
--- a/rbutil/rbutilqt/base/rbsettings.h
+++ b/rbutil/rbutilqt/base/rbsettings.h
@@ -151,7 +151,7 @@ class RbSettings : public QObject
//! pointers to our setting objects
static QSettings *systemSettings;
static QSettings *userSettings;
- static QSettings *serverSettings;
+ static QMap<QString, QVariant> serverSettings;
};
#endif