diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-11-04 20:26:36 -0700 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-12-02 19:42:50 +0000 |
commit | 2acb61f7b0920ca9621459804c0c1af833524577 (patch) | |
tree | ad510eac19f1061ae20232e8872404eb37ce0dcd | |
parent | 048f431737f71813bf9ccc2a8300107ce0ba2020 (diff) |
Q*FActory: remove unused path arguments
Cargo-culted from somewhere but not used in any of these classes. This
just made the code bigger for no reason.
Also take the opportunity to make it work with !QT_CONFIG(library),
which apparently no one bothered to try because it clearly didn't
compile. Not that I have tried either...
Task-number: QTBUG-97950
Change-Id: Ice04365c72984d07a64dfffd16b48632888ed664
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 297fa0d8507b7dc365f9c805d1ab0b0a4e1dd462)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
16 files changed, 48 insertions, 304 deletions
diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp index 02bed461a..115bae104 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory.cpp @@ -48,49 +48,17 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-client"), Qt::CaseInsensitive)) -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, - (QWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) -#endif -QStringList QWaylandClientBufferIntegrationFactory::keys(const QString &pluginPath) +QStringList QWaylandClientBufferIntegrationFactory::keys() { -#if QT_CONFIG(library) - QStringList list; - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - list = directLoader()->keyMap().values(); - if (!list.isEmpty()) { - const QString postFix = QStringLiteral(" (from ") - + QDir::toNativeSeparators(pluginPath) - + QLatin1Char(')'); - const QStringList::iterator end = list.end(); - for (QStringList::iterator it = list.begin(); it != end; ++it) - (*it).append(postFix); - } - } - list.append(loader()->keyMap().values()); - return list; -#else - return QStringList(); -#endif + return loader->keyMap().values(); } -QWaylandClientBufferIntegration *QWaylandClientBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) +QWaylandClientBufferIntegration *QWaylandClientBufferIntegrationFactory::create(const QString &name, const QStringList &args) { -#if QT_CONFIG(library) - // Try loading the plugin from platformPluginPath first: - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - if (QWaylandClientBufferIntegration *ret = qLoadPlugin<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(directLoader(), name, args)) - return ret; - } - if (QWaylandClientBufferIntegration *ret = qLoadPlugin<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(loader(), name, args)) - return ret; -#endif - return nullptr; + return qLoadPlugin<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(loader(), name, args); } } diff --git a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h index 7eaeed16c..29b00f448 100644 --- a/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h +++ b/src/client/hardwareintegration/qwaylandclientbufferintegrationfactory_p.h @@ -63,8 +63,8 @@ class QWaylandClientBufferIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationFactory { public: - static QStringList keys(const QString &pluginPath = QString()); - static QWaylandClientBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); + static QStringList keys(); + static QWaylandClientBufferIntegration *create(const QString &name, const QStringList &args); }; } diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp index 39d65f88d..655639741 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory.cpp @@ -48,49 +48,17 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-client"), Qt::CaseInsensitive)) -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, - (QWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) -#endif -QStringList QWaylandServerBufferIntegrationFactory::keys(const QString &pluginPath) +QStringList QWaylandServerBufferIntegrationFactory::keys() { -#if QT_CONFIG(library) - QStringList list; - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - list = directLoader()->keyMap().values(); - if (!list.isEmpty()) { - const QString postFix = QStringLiteral(" (from ") - + QDir::toNativeSeparators(pluginPath) - + QLatin1Char(')'); - const QStringList::iterator end = list.end(); - for (QStringList::iterator it = list.begin(); it != end; ++it) - (*it).append(postFix); - } - } - list.append(loader()->keyMap().values()); - return list; -#else - return QStringList(); -#endif + return loader->keyMap().values(); } -QWaylandServerBufferIntegration *QWaylandServerBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) +QWaylandServerBufferIntegration *QWaylandServerBufferIntegrationFactory::create(const QString &name, const QStringList &args) { -#if QT_CONFIG(library) - // Try loading the plugin from platformPluginPath first: - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - if (QWaylandServerBufferIntegration *ret = qLoadPlugin<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(directLoader(), name, args)) - return ret; - } - if (QWaylandServerBufferIntegration *ret = qLoadPlugin<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(loader(), name, args)) - return ret; -#endif - return nullptr; + return qLoadPlugin<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(loader(), name, args); } } diff --git a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h index 600c24c9b..f2e5820cc 100644 --- a/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h +++ b/src/client/hardwareintegration/qwaylandserverbufferintegrationfactory_p.h @@ -63,8 +63,8 @@ class QWaylandServerBufferIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationFactory { public: - static QStringList keys(const QString &pluginPath = QString()); - static QWaylandServerBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); + static QStringList keys(); + static QWaylandServerBufferIntegration *create(const QString &name, const QStringList &args); }; } diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp index 8f573064e..91ed0726b 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory.cpp @@ -48,49 +48,17 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QWaylandInputDeviceIntegrationFactoryInterface_iid, QLatin1String("/wayland-inputdevice-integration"), Qt::CaseInsensitive)) -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, - (QWaylandInputDeviceIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) -#endif -QStringList QWaylandInputDeviceIntegrationFactory::keys(const QString &pluginPath) +QStringList QWaylandInputDeviceIntegrationFactory::keys() { -#if QT_CONFIG(library) - QStringList list; - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - list = directLoader()->keyMap().values(); - if (!list.isEmpty()) { - const QString postFix = QStringLiteral(" (from ") - + QDir::toNativeSeparators(pluginPath) - + QLatin1Char(')'); - const QStringList::iterator end = list.end(); - for (QStringList::iterator it = list.begin(); it != end; ++it) - (*it).append(postFix); - } - } - list.append(loader()->keyMap().values()); - return list; -#else - return QStringList(); -#endif + return loader->keyMap().values(); } -QWaylandInputDeviceIntegration *QWaylandInputDeviceIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) +QWaylandInputDeviceIntegration *QWaylandInputDeviceIntegrationFactory::create(const QString &name, const QStringList &args) { -#if QT_CONFIG(library) - // Try loading the plugin from platformPluginPath first: - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - if (QWaylandInputDeviceIntegration *ret = qLoadPlugin<QWaylandInputDeviceIntegration, QWaylandInputDeviceIntegrationPlugin>(directLoader(), name, args)) - return ret; - } - if (QWaylandInputDeviceIntegration *ret = qLoadPlugin<QWaylandInputDeviceIntegration, QWaylandInputDeviceIntegrationPlugin>(loader(), name, args)) - return ret; -#endif - return nullptr; + return qLoadPlugin<QWaylandInputDeviceIntegration, QWaylandInputDeviceIntegrationPlugin>(loader(), name, args); } } diff --git a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h index 80096e790..776fcf3ee 100644 --- a/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h +++ b/src/client/inputdeviceintegration/qwaylandinputdeviceintegrationfactory_p.h @@ -63,8 +63,8 @@ class QWaylandInputDeviceIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegrationFactory { public: - static QStringList keys(const QString &pluginPath = QString()); - static QWaylandInputDeviceIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); + static QStringList keys(); + static QWaylandInputDeviceIntegration *create(const QString &name, const QStringList &args); }; } diff --git a/src/client/qwaylanddecorationfactory.cpp b/src/client/qwaylanddecorationfactory.cpp index 32db96e58..49051d53b 100644 --- a/src/client/qwaylanddecorationfactory.cpp +++ b/src/client/qwaylanddecorationfactory.cpp @@ -48,50 +48,17 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QWaylandDecorationFactoryInterface_iid, QLatin1String("/wayland-decoration-client"), Qt::CaseInsensitive)) -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, - (QWaylandDecorationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) -#endif -QStringList QWaylandDecorationFactory::keys(const QString &pluginPath) +QStringList QWaylandDecorationFactory::keys() { -#if QT_CONFIG(library) - QStringList list; - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - list = directLoader()->keyMap().values(); - if (!list.isEmpty()) { - const QString postFix = QStringLiteral(" (from ") - + QDir::toNativeSeparators(pluginPath) - + QLatin1Char(')'); - const QStringList::iterator end = list.end(); - for (QStringList::iterator it = list.begin(); it != end; ++it) - (*it).append(postFix); - } - } - list.append(loader()->keyMap().values()); - return list; -#else - return QStringList(); -#endif + return loader->keyMap().values(); } -QWaylandAbstractDecoration *QWaylandDecorationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) +QWaylandAbstractDecoration *QWaylandDecorationFactory::create(const QString &name, const QStringList &args) { -#if QT_CONFIG(library) - // Try loading the plugin from platformPluginPath first: - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - if (QWaylandAbstractDecoration *ret = qLoadPlugin<QWaylandAbstractDecoration, QWaylandDecorationPlugin>(directLoader(), name, args)) - return ret; - } - if (QWaylandAbstractDecoration *ret = qLoadPlugin<QWaylandAbstractDecoration, QWaylandDecorationPlugin>(loader(), name, args)) - return ret; -#endif - - return nullptr; + return qLoadPlugin<QWaylandAbstractDecoration, QWaylandDecorationPlugin>(loader(), name, args); } } diff --git a/src/client/qwaylanddecorationfactory_p.h b/src/client/qwaylanddecorationfactory_p.h index 606d9b89c..98473d48d 100644 --- a/src/client/qwaylanddecorationfactory_p.h +++ b/src/client/qwaylanddecorationfactory_p.h @@ -63,8 +63,8 @@ class QWaylandAbstractDecoration; class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationFactory { public: - static QStringList keys(const QString &pluginPath = QString()); - static QWaylandAbstractDecoration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); + static QStringList keys(); + static QWaylandAbstractDecoration *create(const QString &name, const QStringList &args); }; } diff --git a/src/client/shellintegration/qwaylandshellintegrationfactory.cpp b/src/client/shellintegration/qwaylandshellintegrationfactory.cpp index 48fda14d4..e3a9aeb37 100644 --- a/src/client/shellintegration/qwaylandshellintegrationfactory.cpp +++ b/src/client/shellintegration/qwaylandshellintegrationfactory.cpp @@ -48,49 +48,18 @@ QT_BEGIN_NAMESPACE namespace QtWaylandClient { -#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QWaylandShellIntegrationFactoryInterface_iid, QLatin1String("/wayland-shell-integration"), Qt::CaseInsensitive)) -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, - (QWaylandShellIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) -#endif -QStringList QWaylandShellIntegrationFactory::keys(const QString &pluginPath) +QStringList QWaylandShellIntegrationFactory::keys() { -#if QT_CONFIG(library) - QStringList list; - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - list = directLoader()->keyMap().values(); - if (!list.isEmpty()) { - const QString postFix = QStringLiteral(" (from ") - + QDir::toNativeSeparators(pluginPath) - + QLatin1Char(')'); - const QStringList::iterator end = list.end(); - for (QStringList::iterator it = list.begin(); it != end; ++it) - (*it).append(postFix); - } - } - list.append(loader()->keyMap().values()); - return list; -#else - return QStringList(); -#endif + return loader->keyMap().values(); } -QWaylandShellIntegration *QWaylandShellIntegrationFactory::create(const QString &name, QWaylandDisplay *display, const QStringList &args, const QString &pluginPath) +QWaylandShellIntegration *QWaylandShellIntegrationFactory::create(const QString &name, QWaylandDisplay *display, const QStringList &args) { -#if QT_CONFIG(library) QScopedPointer<QWaylandShellIntegration> integration; - - // Try loading the plugin from platformPluginPath first: - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - integration.reset(qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(directLoader(), name, args)); - } - if (!integration) - integration.reset(qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(loader(), name, args)); -#endif + integration.reset(qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(loader(), name, args)); if (integration && !integration->initialize(display)) return nullptr; diff --git a/src/client/shellintegration/qwaylandshellintegrationfactory_p.h b/src/client/shellintegration/qwaylandshellintegrationfactory_p.h index 515a18e1f..0268dba48 100644 --- a/src/client/shellintegration/qwaylandshellintegrationfactory_p.h +++ b/src/client/shellintegration/qwaylandshellintegrationfactory_p.h @@ -66,8 +66,8 @@ class QWaylandShellIntegration; class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationFactory { public: - static QStringList keys(const QString &pluginPath = QString()); - static QWaylandShellIntegration *create(const QString &name, QWaylandDisplay *display, const QStringList &args = QStringList(), const QString &pluginPath = QString()); + static QStringList keys(); + static QWaylandShellIntegration *create(const QString &name, QWaylandDisplay *display, const QStringList &args = QStringList()); }; } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp index 982b4ded7..a888adb7a 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory.cpp @@ -38,49 +38,17 @@ QT_BEGIN_NAMESPACE namespace QtWayland { -#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QtWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-server"), Qt::CaseInsensitive)) -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, - (QtWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) -#endif -QStringList ClientBufferIntegrationFactory::keys(const QString &pluginPath) +QStringList ClientBufferIntegrationFactory::keys() { -#if QT_CONFIG(library) - QStringList list; - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - list = directLoader()->keyMap().values(); - if (!list.isEmpty()) { - const QString postFix = QStringLiteral(" (from ") - + QDir::toNativeSeparators(pluginPath) - + QLatin1Char(')'); - const QStringList::iterator end = list.end(); - for (QStringList::iterator it = list.begin(); it != end; ++it) - (*it).append(postFix); - } - } - list.append(loader()->keyMap().values()); - return list; -#else - return QStringList(); -#endif + return loader->keyMap().values(); } -ClientBufferIntegration *ClientBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) +ClientBufferIntegration *ClientBufferIntegrationFactory::create(const QString &name, const QStringList &args) { -#if QT_CONFIG(library) - // Try loading the plugin from platformPluginPath first: - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - if (ClientBufferIntegration *ret = qLoadPlugin<ClientBufferIntegration, ClientBufferIntegrationPlugin>(directLoader(), name, args)) - return ret; - } - if (ClientBufferIntegration *ret = qLoadPlugin<ClientBufferIntegration, ClientBufferIntegrationPlugin>(loader(), name, args)) - return ret; -#endif - return nullptr; + return qLoadPlugin<ClientBufferIntegration, ClientBufferIntegrationPlugin>(loader(), name, args); } } diff --git a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h index 0a7c1b845..5563a1687 100644 --- a/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h +++ b/src/compositor/hardware_integration/qwlclientbufferintegrationfactory_p.h @@ -53,8 +53,8 @@ class ClientBufferIntegration; class Q_WAYLAND_COMPOSITOR_EXPORT ClientBufferIntegrationFactory { public: - static QStringList keys(const QString &pluginPath = QString()); - static ClientBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); + static QStringList keys(); + static ClientBufferIntegration *create(const QString &name, const QStringList &args); }; } diff --git a/src/compositor/hardware_integration/qwlhardwarelayerintegrationfactory.cpp b/src/compositor/hardware_integration/qwlhardwarelayerintegrationfactory.cpp index e30f04c54..0f25225a4 100644 --- a/src/compositor/hardware_integration/qwlhardwarelayerintegrationfactory.cpp +++ b/src/compositor/hardware_integration/qwlhardwarelayerintegrationfactory.cpp @@ -39,49 +39,17 @@ QT_BEGIN_NAMESPACE namespace QtWayland { -#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QtWaylandHardwareLayerIntegrationFactoryInterface_iid, QLatin1String("/wayland-hardware-layer-integration"), Qt::CaseInsensitive)) -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, - (QtWaylandHardwareLayerIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) -#endif -QStringList HardwareLayerIntegrationFactory::keys(const QString &pluginPath) +QStringList HardwareLayerIntegrationFactory::keys() { -#if QT_CONFIG(library) - QStringList list; - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - list = directLoader()->keyMap().values(); - if (!list.isEmpty()) { - const QString postFix = QStringLiteral(" (from ") - + QDir::toNativeSeparators(pluginPath) - + QLatin1Char(')'); - const QStringList::iterator end = list.end(); - for (QStringList::iterator it = list.begin(); it != end; ++it) - (*it).append(postFix); - } - } - list.append(loader()->keyMap().values()); - return list; -#else - return QStringList(); -#endif + return loader->keyMap().values(); } -HardwareLayerIntegration *HardwareLayerIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) +HardwareLayerIntegration *HardwareLayerIntegrationFactory::create(const QString &name, const QStringList &args) { -#if QT_CONFIG(library) - // Try loading the plugin from platformPluginPath first: - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - if (HardwareLayerIntegration *ret = qLoadPlugin<HardwareLayerIntegration, HardwareLayerIntegrationPlugin>(directLoader(), name, args)) - return ret; - } - if (HardwareLayerIntegration *ret = qLoadPlugin<HardwareLayerIntegration, HardwareLayerIntegrationPlugin>(loader(), name, args)) - return ret; -#endif - return nullptr; + return qLoadPlugin<HardwareLayerIntegration, HardwareLayerIntegrationPlugin>(loader(), name, args); } } diff --git a/src/compositor/hardware_integration/qwlhardwarelayerintegrationfactory_p.h b/src/compositor/hardware_integration/qwlhardwarelayerintegrationfactory_p.h index 0f6dfd5cf..58f898844 100644 --- a/src/compositor/hardware_integration/qwlhardwarelayerintegrationfactory_p.h +++ b/src/compositor/hardware_integration/qwlhardwarelayerintegrationfactory_p.h @@ -53,8 +53,8 @@ class HardwareLayerIntegration; class Q_WAYLAND_COMPOSITOR_EXPORT HardwareLayerIntegrationFactory { public: - static QStringList keys(const QString &pluginPath = QString()); - static HardwareLayerIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); + static QStringList keys(); + static HardwareLayerIntegration *create(const QString &name, const QStringList &args); }; } diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp index a68a62fc8..74865321d 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory.cpp @@ -38,49 +38,17 @@ QT_BEGIN_NAMESPACE namespace QtWayland { -#if QT_CONFIG(library) Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QtWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-server"), Qt::CaseInsensitive)) -Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, - (QtWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive)) -#endif -QStringList ServerBufferIntegrationFactory::keys(const QString &pluginPath) +QStringList ServerBufferIntegrationFactory::keys() { -#if QT_CONFIG(library) - QStringList list; - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - list = directLoader()->keyMap().values(); - if (!list.isEmpty()) { - const QString postFix = QStringLiteral(" (from ") - + QDir::toNativeSeparators(pluginPath) - + QLatin1Char(')'); - const QStringList::iterator end = list.end(); - for (QStringList::iterator it = list.begin(); it != end; ++it) - (*it).append(postFix); - } - } - list.append(loader()->keyMap().values()); - return list; -#else - return QStringList(); -#endif + return loader->keyMap().values(); } -ServerBufferIntegration *ServerBufferIntegrationFactory::create(const QString &name, const QStringList &args, const QString &pluginPath) +ServerBufferIntegration *ServerBufferIntegrationFactory::create(const QString &name, const QStringList &args) { -#if QT_CONFIG(library) - // Try loading the plugin from platformPluginPath first: - if (!pluginPath.isEmpty()) { - QCoreApplication::addLibraryPath(pluginPath); - if (ServerBufferIntegration *ret = qLoadPlugin<ServerBufferIntegration, ServerBufferIntegrationPlugin>(directLoader(), name, args)) - return ret; - } - if (ServerBufferIntegration *ret = qLoadPlugin<ServerBufferIntegration, ServerBufferIntegrationPlugin>(loader(), name, args)) - return ret; -#endif - return nullptr; + return qLoadPlugin<ServerBufferIntegration, ServerBufferIntegrationPlugin>(loader(), name, args); } } diff --git a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h index 9efc4afc8..f64dc87dc 100644 --- a/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h +++ b/src/compositor/hardware_integration/qwlserverbufferintegrationfactory_p.h @@ -53,8 +53,8 @@ class ServerBufferIntegration; class Q_WAYLAND_COMPOSITOR_EXPORT ServerBufferIntegrationFactory { public: - static QStringList keys(const QString &pluginPath = QString()); - static ServerBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString()); + static QStringList keys(); + static ServerBufferIntegration *create(const QString &name, const QStringList &args); }; } |