From 527406cbd99f44470ef87468b73c18df949e8ac7 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 12 Nov 2018 09:40:47 +0100 Subject: Modernize the "settings" feature Change-Id: I9b8a61ecb1413b513ae5c9e77d3ee1b3e8b6562c Reviewed-by: Edward Welbourne Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qconfig-bootstrapped.h | 2 ++ src/corelib/global/qlibraryinfo.cpp | 14 ++++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index 229b4d17a1..f62137fe66 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -126,11 +126,13 @@ #define QT_FEATURE_commandlineparser -1 #define QT_NO_COMPRESS #define QT_JSON_READONLY +#define QT_FEATURE_settings 1 #define QT_NO_STANDARDPATHS #define QT_FEATURE_textcodec -1 #else #define QT_FEATURE_codecs -1 #define QT_FEATURE_commandlineparser 1 +#define QT_FEATURE_settings -1 #define QT_FEATURE_textcodec 1 #endif diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index e727f00c8e..4119012d85 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -41,7 +41,9 @@ #include "qdir.h" #include "qstringlist.h" #include "qfile.h" +#if QT_CONFIG(settings) #include "qsettings.h" +#endif #include "qlibraryinfo.h" #include "qscopedpointer.h" @@ -67,7 +69,7 @@ QT_BEGIN_NAMESPACE extern void qDumpCPUFeatures(); // in qsimd.cpp -#ifndef QT_NO_SETTINGS +#if QT_CONFIG(settings) struct QLibrarySettings { @@ -204,7 +206,7 @@ QSettings *QLibraryInfoPrivate::findConfiguration() return 0; //no luck } -#endif // QT_NO_SETTINGS +#endif // settings /*! \class QLibraryInfo @@ -464,7 +466,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) #endif // QT_BUILD_QMAKE, started inside location ! QString ret; bool fromConf = false; -#ifndef QT_NO_SETTINGS +#if QT_CONFIG(settings) #ifdef QT_BUILD_QMAKE // Logic for choosing the right data source: if EffectivePaths are requested // and qt.conf with that section is present, use it, otherwise fall back to @@ -547,7 +549,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) ret = QDir::fromNativeSeparators(ret); } } -#endif // QT_NO_SETTINGS +#endif // settings #ifndef QT_BUILD_QMAKE_BOOTSTRAP if (!fromConf) { @@ -646,7 +648,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) { -#if !defined(QT_BUILD_QMAKE) && !defined(QT_NO_SETTINGS) +#if !defined(QT_BUILD_QMAKE) && QT_CONFIG(settings) QScopedPointer settings(QLibraryInfoPrivate::findConfiguration()); if (!settings.isNull()) { const QString key = QLatin1String(platformsSection) @@ -657,7 +659,7 @@ QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) } #else Q_UNUSED(platformName); -#endif // !QT_BUILD_QMAKE && !QT_NO_SETTINGS +#endif // !QT_BUILD_QMAKE && settings return QStringList(); } -- cgit v1.2.3