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>
This commit is contained in:
parent
fbba12d7db
commit
715a39f026
@ -48,49 +48,17 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
#if QT_CONFIG(library)
|
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
||||||
(QWaylandClientBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-client"), Qt::CaseInsensitive))
|
(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)
|
return loader->keyMap().values();
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
return qLoadPlugin<QWaylandClientBufferIntegration, QWaylandClientBufferIntegrationPlugin>(loader(), name, args);
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -63,8 +63,8 @@ class QWaylandClientBufferIntegration;
|
|||||||
class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationFactory
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandClientBufferIntegrationFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QStringList keys(const QString &pluginPath = QString());
|
static QStringList keys();
|
||||||
static QWaylandClientBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
|
static QWaylandClientBufferIntegration *create(const QString &name, const QStringList &args);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -48,49 +48,17 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
#if QT_CONFIG(library)
|
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
||||||
(QWaylandServerBufferIntegrationFactoryInterface_iid, QLatin1String("/wayland-graphics-integration-client"), Qt::CaseInsensitive))
|
(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)
|
return loader->keyMap().values();
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
return qLoadPlugin<QWaylandServerBufferIntegration, QWaylandServerBufferIntegrationPlugin>(loader(), name, args);
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -63,8 +63,8 @@ class QWaylandServerBufferIntegration;
|
|||||||
class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationFactory
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegrationFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QStringList keys(const QString &pluginPath = QString());
|
static QStringList keys();
|
||||||
static QWaylandServerBufferIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
|
static QWaylandServerBufferIntegration *create(const QString &name, const QStringList &args);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -48,49 +48,17 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
#if QT_CONFIG(library)
|
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
||||||
(QWaylandInputDeviceIntegrationFactoryInterface_iid, QLatin1String("/wayland-inputdevice-integration"), Qt::CaseInsensitive))
|
(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)
|
return loader->keyMap().values();
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
return qLoadPlugin<QWaylandInputDeviceIntegration, QWaylandInputDeviceIntegrationPlugin>(loader(), name, args);
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -63,8 +63,8 @@ class QWaylandInputDeviceIntegration;
|
|||||||
class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegrationFactory
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandInputDeviceIntegrationFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QStringList keys(const QString &pluginPath = QString());
|
static QStringList keys();
|
||||||
static QWaylandInputDeviceIntegration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
|
static QWaylandInputDeviceIntegration *create(const QString &name, const QStringList &args);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -48,50 +48,17 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
#if QT_CONFIG(library)
|
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
||||||
(QWaylandDecorationFactoryInterface_iid, QLatin1String("/wayland-decoration-client"), Qt::CaseInsensitive))
|
(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)
|
return loader->keyMap().values();
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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)
|
return qLoadPlugin<QWaylandAbstractDecoration, QWaylandDecorationPlugin>(loader(), name, args);
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -63,8 +63,8 @@ class QWaylandAbstractDecoration;
|
|||||||
class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationFactory
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandDecorationFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QStringList keys(const QString &pluginPath = QString());
|
static QStringList keys();
|
||||||
static QWaylandAbstractDecoration *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
|
static QWaylandAbstractDecoration *create(const QString &name, const QStringList &args);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -48,49 +48,18 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
namespace QtWaylandClient {
|
namespace QtWaylandClient {
|
||||||
|
|
||||||
#if QT_CONFIG(library)
|
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader,
|
||||||
(QWaylandShellIntegrationFactoryInterface_iid, QLatin1String("/wayland-shell-integration"), Qt::CaseInsensitive))
|
(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)
|
return loader->keyMap().values();
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
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));
|
integration.reset(qLoadPlugin<QWaylandShellIntegration, QWaylandShellIntegrationPlugin>(loader(), name, args));
|
||||||
#endif
|
|
||||||
|
|
||||||
if (integration && !integration->initialize(display))
|
if (integration && !integration->initialize(display))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -66,8 +66,8 @@ class QWaylandShellIntegration;
|
|||||||
class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationFactory
|
class Q_WAYLAND_CLIENT_EXPORT QWaylandShellIntegrationFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QStringList keys(const QString &pluginPath = QString());
|
static QStringList keys();
|
||||||
static QWaylandShellIntegration *create(const QString &name, QWaylandDisplay *display, const QStringList &args = QStringList(), const QString &pluginPath = QString());
|
static QWaylandShellIntegration *create(const QString &name, QWaylandDisplay *display, const QStringList &args = QStringList());
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user