diff options
author | Palo Kisa <palo.kisa@gmail.com> | 2016-08-24 02:14:32 +0200 |
---|---|---|
committer | Palo Kisa <palo.kisa@gmail.com> | 2016-09-27 22:03:04 +0000 |
commit | ee35fbbf526d18d5cebd425d0d36dbdc74984273 (patch) | |
tree | d40759c5958dec0968b5c51557d6a3ddd2c072d9 /src/corelib/io/qsettings_p.h | |
parent | 99b6eb4382e135815b53b567297be9cd4ecfd96a (diff) |
qsettings: Simplify confFiles logic
Use a QVector to hold the QConfFile(s) to allow more configuration
files than the statically defined number -> this will allow considering
multiple system-wide configuration files if needed.
To use a dynamic container we get rid of use QScopedSharedPointer, which
actually wasn't needed anyway, as the "deref" logic was/is done manually
in the QConfFileSettingsPrivate destructor.
Change-Id: Ie9341da2cbe2e2b1379f9e2538cb4c9ebbd6fc97
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io/qsettings_p.h')
-rw-r--r-- | src/corelib/io/qsettings_p.h | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/corelib/io/qsettings_p.h b/src/corelib/io/qsettings_p.h index e6d3413bab..639605d8c4 100644 --- a/src/corelib/io/qsettings_p.h +++ b/src/corelib/io/qsettings_p.h @@ -236,19 +236,6 @@ public: QTextCodec *codec); static QStringList splitArgs(const QString &s, int idx); - /* - The numeric values of these enums define their search order. For example, - F_User | F_Organization is searched before F_System | F_Application, - because their values are respectively 1 and 2. - */ - enum { - F_Application = 0x0, - F_Organization = 0x1, - F_User = 0x0, - F_System = 0x2, - NumConfFiles = 4 - }; - QSettings::Format format; QSettings::Scope scope; QString organizationName; @@ -258,7 +245,6 @@ public: protected: QStack<QSettingsGroup> groupStack; QString groupPrefix; - int spec; bool fallbacks; bool pendingChanges; mutable QSettings::Status status; @@ -293,7 +279,7 @@ public: private: void initFormat(); void initAccess(); - void syncConfFile(int confFileNo); + void syncConfFile(QConfFile *confFile); bool writeIniFile(QIODevice &device, const ParsedSettingsMap &map); #ifdef Q_OS_MAC bool readPlistFile(const QByteArray &data, ParsedSettingsMap *map) const; @@ -302,7 +288,7 @@ private: void ensureAllSectionsParsed(QConfFile *confFile) const; void ensureSectionParsed(QConfFile *confFile, const QSettingsKey &key) const; - QScopedSharedPointer<QConfFile> confFiles[NumConfFiles]; + QVector<QConfFile *> confFiles; QSettings::ReadFunc readFunc; QSettings::WriteFunc writeFunc; QString extension; |