diff options
author | Bernd Weimer <bweimer@rim.com> | 2012-11-22 09:33:25 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-26 21:01:01 (GMT) |
commit | 4cfb94c5fd5cc833deebbe72d85bb957dee5c046 (patch) | |
tree | 3642bd04e42d481d6b42bf7cf44a8b6cb5ed5962 /src/corelib | |
parent | d6bc8bc6de1cd21f86076063cdd905b57dd1007c (diff) | |
download | Qt-4cfb94c5fd5cc833deebbe72d85bb957dee5c046.zip Qt-4cfb94c5fd5cc833deebbe72d85bb957dee5c046.tar.gz Qt-4cfb94c5fd5cc833deebbe72d85bb957dee5c046.tar.bz2 |
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.
Backport from qtbase: 146f63bea487dbc4d6af34b56fa382f5a6a18e82
Change-Id: I0000d6910b56cdb75728422e1889cd5f0c646eb3
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
Reviewed-by: Alan Alpert <aalpert@rim.com>
Diffstat (limited to 'src/corelib')
-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 ffeb664..06a1b6a 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -1163,6 +1163,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; @@ -1177,6 +1178,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]) { @@ -2502,6 +2510,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 2053154..db8c33f 100644 --- a/src/corelib/io/qsettings_p.h +++ b/src/corelib/io/qsettings_p.h @@ -243,11 +243,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; |