diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2013-10-10 14:40:14 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-16 13:10:02 +0200 |
commit | 0232fa3979e0e5d8485de94950f514bfd861d22b (patch) | |
tree | 68f09e10c5a36df226a40a295bc80fa871ee5291 /src/corelib/global | |
parent | da35793ee5cf73c45e3d1d9a994abf8be61fff14 (diff) |
Add platform plugin arguments to QLibraryInfo/qt.conf.
Make it possible to specify arguments to the platform plugins in a
section of the qt.conf file:
[Platforms]
WindowsArguments=fontengine=freetype
Change-Id: Ia05d0fa004471dcb74c78a88eec3b220ec3c6ad8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 33 | ||||
-rw-r--r-- | src/corelib/global/qlibraryinfo.h | 4 |
2 files changed, 36 insertions, 1 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 8d681f0c4c..9bc7506e39 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "qdir.h" +#include "qstringlist.h" #include "qfile.h" #include "qsettings.h" #include "qlibraryinfo.h" @@ -113,6 +114,8 @@ public: } }; +static const char platformsSection[] = "Platforms"; + QLibrarySettings::QLibrarySettings() : settings(QLibraryInfoPrivate::findConfiguration()) { @@ -132,7 +135,8 @@ QLibrarySettings::QLibrarySettings() haveEffectivePaths = children.contains(QLatin1String("EffectivePaths")); #endif // Backwards compat: an existing but empty file is claimed to contain the Paths section. - havePaths = !haveEffectivePaths || children.contains(QLatin1String("Paths")); + havePaths = (!haveEffectivePaths && !children.contains(QLatin1String(platformsSection))) + || children.contains(QLatin1String("Paths")); #ifndef QT_BOOTSTRAPPED if (!havePaths) settings.reset(0); @@ -462,6 +466,33 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) } /*! + Returns additional arguments to the platform plugin matching + \a platformName which can be specified as a string list using + the key \c Arguments in a group called \c Platforms of the + \c qt.conf file. + + sa {Using qt.conf} + + \internal + + \since 5.3 +*/ + +QStringList QLibraryInfo::platformPluginArguments(const QString &platformName) +{ +#ifndef QT_BOOTSTRAPPED + if (const QSettings *settings = QLibraryInfoPrivate::findConfiguration()) { + QString key = QLatin1String(platformsSection); + key += QLatin1Char('/'); + key += platformName; + key += QLatin1String("Arguments"); + return settings->value(key).toStringList(); + } +#endif // !QT_BOOTSTRAPPED + return QStringList(); +} + +/*! \enum QLibraryInfo::LibraryLocation \keyword library location diff --git a/src/corelib/global/qlibraryinfo.h b/src/corelib/global/qlibraryinfo.h index 17864b555b..54ef794d3e 100644 --- a/src/corelib/global/qlibraryinfo.h +++ b/src/corelib/global/qlibraryinfo.h @@ -47,6 +47,8 @@ QT_BEGIN_NAMESPACE +class QStringList; + class Q_CORE_EXPORT QLibraryInfo { public: @@ -96,6 +98,8 @@ public: static QString rawLocation(LibraryLocation, PathGroup); #endif + static QStringList platformPluginArguments(const QString &platformName); + private: QLibraryInfo(); }; |