From 3ba1a196aaac8f480c0fcb4fc005c1f4e7d7f88b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 4 Nov 2021 19:22:20 -0700 Subject: [PATCH] Q{XcbGl,EglFSDevice}IntegrationFactory: remove unused extra plugin path Cargo-cult copied this from somewhere, unnecessarily. This just made the code bigger for no reason. Task-number: QTBUG-97950 Pick-to: 6.2 Change-Id: Ice04365c72984d07a64dfffd16b48520d42c7043 Reviewed-by: Lars Knoll --- .../eglfs/api/qeglfsdeviceintegration.cpp | 34 ++----------------- .../eglfs/api/qeglfsdeviceintegration_p.h | 4 +-- .../qxcbglintegrationfactory.cpp | 17 +--------- .../qxcbglintegrationfactory.h | 2 +- 4 files changed, 6 insertions(+), 51 deletions(-) diff --git a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp index 813de2fc47..09c102b66f 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp +++ b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp @@ -74,47 +74,17 @@ Q_LOGGING_CATEGORY(qLcEglDevDebug, "qt.qpa.egldeviceintegration") Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QEglFSDeviceIntegrationFactoryInterface_iid, QLatin1String("/egldeviceintegrations"), Qt::CaseInsensitive)) -#if QT_CONFIG(library) -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, - (QEglFSDeviceIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) - -#endif // QT_CONFIG(library) - -QStringList QEglFSDeviceIntegrationFactory::keys(const QString &pluginPath) +QStringList QEglFSDeviceIntegrationFactory::keys() { QStringList list; -#if QT_CONFIG(library) - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - list = directLoader()->keyMap().values(); - if (!list.isEmpty()) { - const QString postFix = QLatin1String(" (from ") - + QDir::toNativeSeparators(pluginPath) - + QLatin1Char(')'); - const QStringList::iterator end = list.end(); - for (QStringList::iterator it = list.begin(); it != end; ++it) - (*it).append(postFix); - } - } -#else - Q_UNUSED(pluginPath); -#endif list.append(loader()->keyMap().values()); qCDebug(qLcEglDevDebug) << "EGL device integration plugin keys:" << list; return list; } -QEglFSDeviceIntegration *QEglFSDeviceIntegrationFactory::create(const QString &key, const QString &pluginPath) +QEglFSDeviceIntegration *QEglFSDeviceIntegrationFactory::create(const QString &key) { QEglFSDeviceIntegration *integration = nullptr; -#if QT_CONFIG(library) - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - integration = qLoadPlugin(directLoader(), key); - } -#else - Q_UNUSED(pluginPath); -#endif if (!integration) integration = qLoadPlugin(loader(), key); if (integration) diff --git a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration_p.h b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration_p.h index f8c0d6c508..4e43a7c37b 100644 --- a/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration_p.h +++ b/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration_p.h @@ -126,8 +126,8 @@ public: class Q_EGLFS_EXPORT QEglFSDeviceIntegrationFactory { public: - static QStringList keys(const QString &pluginPath = QString()); - static QEglFSDeviceIntegration *create(const QString &name, const QString &platformPluginPath = QString()); + static QStringList keys(); + static QEglFSDeviceIntegration *create(const QString &name); }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp index d69d969783..8412663e3c 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.cpp @@ -50,23 +50,8 @@ QT_BEGIN_NAMESPACE Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QXcbGlIntegrationFactoryInterface_iid, QLatin1String("/xcbglintegrations"), Qt::CaseInsensitive)) -#if QT_CONFIG(library) -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, - (QXcbGlIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) -#endif // QT_CONFIG(library) - -QXcbGlIntegration *QXcbGlIntegrationFactory::create(const QString &platform, const QString &pluginPath) +QXcbGlIntegration *QXcbGlIntegrationFactory::create(const QString &platform) { -#if QT_CONFIG(library) - // Try loading the plugin from pluginPath first: - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - if (QXcbGlIntegration *ret = qLoadPlugin(directLoader(), platform)) - return ret; - } -#else - Q_UNUSED(pluginPath); -#endif return qLoadPlugin(loader(), platform); } diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h index c4aa0a3d8d..30ddeb2297 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegrationfactory.h @@ -49,7 +49,7 @@ class QXcbGlIntegration; class QXcbGlIntegrationFactory { public: - static QXcbGlIntegration *create(const QString &name, const QString &platformPluginPath = QString()); + static QXcbGlIntegration *create(const QString &name); }; QT_END_NAMESPACE