diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-11-04 20:26:36 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2021-12-02 09:02:23 -0800 |
commit | 297fa0d8507b7dc365f9c805d1ab0b0a4e1dd462 (patch) | |
tree | 696d8f9482be2f58ff72e9518809601b63bec76b /src/client/shellintegration | |
parent | 46ed85a80b28d519cf5887bbdce55d1bf57886c3 (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
Pick-to: 6.2
Change-Id: Ice04365c72984d07a64dfffd16b48632888ed664
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'src/client/shellintegration')
-rw-r--r-- | src/client/shellintegration/qwaylandshellintegrationfactory.cpp | 39 | ||||
-rw-r--r-- | src/client/shellintegration/qwaylandshellintegrationfactory_p.h | 4 |
2 files changed, 6 insertions, 37 deletions
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()); }; } |