summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qlibraryinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global/qlibraryinfo.cpp')
-rw-r--r--src/corelib/global/qlibraryinfo.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 1c3b09f602..22a9980812 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);
@@ -466,6 +470,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