From 16cd053331d21bb1db9197bcbae783f28a1e0c9b Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 22 Jun 2015 18:14:43 +0200 Subject: Allow loading of static platform plugins with QT_NO_LIBRARY As most of QFactoryLoader is now available with QT_NO_LIBRARY, we can use it to load static platform plugins. Task-number: QTBUG-3045 Change-Id: Idaf2d62fe43774c12d8777f2cf4afaa099833801 Reviewed-by: Thiago Macieira --- src/gui/kernel/qplatformintegrationfactory.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/gui/kernel/qplatformintegrationfactory.cpp') diff --git a/src/gui/kernel/qplatformintegrationfactory.cpp b/src/gui/kernel/qplatformintegrationfactory.cpp index 5a1fb3ca83..d109ceb2f0 100644 --- a/src/gui/kernel/qplatformintegrationfactory.cpp +++ b/src/gui/kernel/qplatformintegrationfactory.cpp @@ -42,11 +42,13 @@ QT_BEGIN_NAMESPACE -#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QPlatformIntegrationFactoryInterface_iid, QLatin1String("/platforms"), Qt::CaseInsensitive)) + +#ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, (QPlatformIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) +#endif // !QT_NO_LIBRARY static inline QPlatformIntegration *loadIntegration(QFactoryLoader *loader, const QString &key, const QStringList ¶meters, int &argc, char ** argv) { @@ -59,8 +61,6 @@ static inline QPlatformIntegration *loadIntegration(QFactoryLoader *loader, cons return 0; } -#endif // !QT_NO_LIBRARY - QPlatformIntegration *QPlatformIntegrationFactory::create(const QString &platform, const QStringList ¶mList, int &argc, char **argv, const QString &platformPluginPath) { #ifndef QT_NO_LIBRARY @@ -70,16 +70,10 @@ QPlatformIntegration *QPlatformIntegrationFactory::create(const QString &platfor if (QPlatformIntegration *ret = loadIntegration(directLoader(), platform, paramList, argc, argv)) return ret; } - if (QPlatformIntegration *ret = loadIntegration(loader(), platform, paramList, argc, argv)) - return ret; #else - Q_UNUSED(platform); - Q_UNUSED(paramList); - Q_UNUSED(argc); - Q_UNUSED(argv); Q_UNUSED(platformPluginPath); #endif - return 0; + return loadIntegration(loader(), platform, paramList, argc, argv); } /*! -- cgit v1.2.3