diff options
Diffstat (limited to 'src/gui/kernel/qplatformintegrationfactory.cpp')
-rw-r--r-- | src/gui/kernel/qplatformintegrationfactory.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/gui/kernel/qplatformintegrationfactory.cpp b/src/gui/kernel/qplatformintegrationfactory.cpp index d109ceb2f0..2c8a7ce0f8 100644 --- a/src/gui/kernel/qplatformintegrationfactory.cpp +++ b/src/gui/kernel/qplatformintegrationfactory.cpp @@ -50,30 +50,19 @@ 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) -{ - const int index = loader->indexOf(key); - if (index != -1) { - if (QPlatformIntegrationPlugin *factory = qobject_cast<QPlatformIntegrationPlugin *>(loader->instance(index))) - if (QPlatformIntegration *result = factory->create(key, parameters, argc, argv)) - return result; - } - return 0; -} - QPlatformIntegration *QPlatformIntegrationFactory::create(const QString &platform, const QStringList ¶mList, int &argc, char **argv, const QString &platformPluginPath) { #ifndef QT_NO_LIBRARY // Try loading the plugin from platformPluginPath first: if (!platformPluginPath.isEmpty()) { QCoreApplication::addLibraryPath(platformPluginPath); - if (QPlatformIntegration *ret = loadIntegration(directLoader(), platform, paramList, argc, argv)) + if (QPlatformIntegration *ret = qLoadPlugin<QPlatformIntegration, QPlatformIntegrationPlugin>(directLoader(), platform, paramList, argc, argv)) return ret; } #else Q_UNUSED(platformPluginPath); #endif - return loadIntegration(loader(), platform, paramList, argc, argv); + return qLoadPlugin<QPlatformIntegration, QPlatformIntegrationPlugin>(loader(), platform, paramList, argc, argv); } /*! |