diff options
author | Bernd Weimer <bweimer@rim.com> | 2012-11-16 11:35:35 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-21 16:36:50 +0100 |
commit | 146f63bea487dbc4d6af34b56fa382f5a6a18e82 (patch) | |
tree | b52cd189a4436f292fb392f25c71978c17544511 /src | |
parent | 131b86347384a97a7044942acd723c4ef5669636 (diff) |
BlackBerry: Changed QSettings file access
On the BlackBerry platform, applications run in a sandbox. They are
not allowed to read or write outside of this sandbox. Hence in
QSettings there is no use for the system scope and differentiating
between organization and application. This change will also improve
performance.
Change-Id: I79fee0140595385f3d33bd89fe5daa36b04836bc
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Alan Alpert (RIM) <aalpert@rim.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/io/qsettings.cpp | 18 | ||||
-rw-r--r-- | src/corelib/io/qsettings_p.h | 15 |
2 files changed, 28 insertions, 5 deletions
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 122fe9f512..c23d2a22e1 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -1156,6 +1156,7 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format, org = QLatin1String("Unknown Organization"); } +#if !defined(Q_OS_BLACKBERRY) QString appFile = org + QDir::separator() + application + extension; QString orgFile = org + extension; @@ -1170,6 +1171,13 @@ QConfFileSettingsPrivate::QConfFileSettingsPrivate(QSettings::Format format, if (!application.isEmpty()) confFiles[F_System | F_Application].reset(QConfFile::fromName(systemPath + appFile, false)); confFiles[F_System | F_Organization].reset(QConfFile::fromName(systemPath + orgFile, false)); +#else + QString confName = getPath(format, QSettings::UserScope) + org; + if (!application.isEmpty()) + confName += QDir::separator() + application; + confName += extension; + confFiles[SandboxConfFile].reset(QConfFile::fromName(confName, true)); +#endif for (i = 0; i < NumConfFiles; ++i) { if (confFiles[i]) { @@ -2430,6 +2438,16 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, running. Also, the locking isn't performed when accessing \c .plist files. + \o On the BlackBerry platform, applications run in a sandbox. They are not + allowed to read or write outside of this sandbox. This involves the + following limitations: + \list + \o As there is only a single scope the scope is simply ignored. + \o The \l{Fallback Mechanism} is not applied, i.e. only a single + location is considered. + \o It is advised against setting and using custom file paths. + \endlist + \endlist \sa QVariant, QSessionManager, {Settings Editor Example}, {Application Example} diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h index 22c43b1348..eb2b1633c5 100644 --- a/src/corelib/io/qsettings_p.h +++ b/src/corelib/io/qsettings_p.h @@ -239,11 +239,16 @@ public: because their values are respectively 1 and 2. */ enum { - F_Application = 0x0, - F_Organization = 0x1, - F_User = 0x0, - F_System = 0x2, - NumConfFiles = 4 +#if !defined(Q_OS_BLACKBERRY) + F_Application = 0x0, + F_Organization = 0x1, + F_User = 0x0, + F_System = 0x2, + NumConfFiles = 4 +#else + SandboxConfFile = 0, + NumConfFiles = 1 +#endif }; QSettings::Format format; |