mirror of https://github.com/qt/qtgamepad.git
Q*FActory: remove unused path arguments
Cargo-culted from somewhere but not used here. This just made the code bigger for no reason. Task-number: QTBUG-97950 Pick-to: 6.2 Change-Id: Ice04365c72984d07a64dfffd16b48632888ed664 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
parent
41732a6ae4
commit
2e0c1b8261
|
|
@ -46,49 +46,15 @@
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QtGamepadBackendFactoryInterface_iid, QLatin1String("/gamepads"), Qt::CaseInsensitive))
|
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QtGamepadBackendFactoryInterface_iid, QLatin1String("/gamepads"), Qt::CaseInsensitive))
|
||||||
#if QT_CONFIG(library)
|
|
||||||
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, directLoader, (QtGamepadBackendFactoryInterface_iid, QLatin1String(""), Qt::CaseInsensitive))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QStringList QGamepadBackendFactory::keys(const QString &pluginPath)
|
QStringList QGamepadBackendFactory::keys()
|
||||||
{
|
{
|
||||||
QStringList list;
|
return loader->keyMap().values();
|
||||||
if (!pluginPath.isEmpty()) {
|
|
||||||
#if QT_CONFIG(library)
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
qWarning("Cannot query QGamepadBackend plugins at %s: Library loading is disabled.",
|
|
||||||
pluginPath.toLocal8Bit().constData());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
list.append(loader()->keyMap().values());
|
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QGamepadBackend *QGamepadBackendFactory::create(const QString &name, const QStringList &args, const QString &pluginPath)
|
QGamepadBackend *QGamepadBackendFactory::create(const QString &name, const QStringList &args)
|
||||||
{
|
{
|
||||||
if (!pluginPath.isEmpty()) {
|
return qLoadPlugin<QGamepadBackend, QGamepadBackendPlugin>(loader(), name, args);
|
||||||
#if QT_CONFIG(library)
|
|
||||||
QCoreApplication::addLibraryPath(pluginPath);
|
|
||||||
if (QGamepadBackend *ret = qLoadPlugin<QGamepadBackend, QGamepadBackendPlugin>(directLoader(), name, args))
|
|
||||||
return ret;
|
|
||||||
#else
|
|
||||||
qWarning("Cannot load QGamepadBackend plugin from %s. Library loading is disabled.",
|
|
||||||
pluginPath.toLocal8Bit().constData());
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if (QGamepadBackend *ret = qLoadPlugin<QGamepadBackend, QGamepadBackendPlugin>(loader(), name, args))
|
|
||||||
return ret;
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@ class QGamepadBackend;
|
||||||
class Q_GAMEPAD_EXPORT QGamepadBackendFactory
|
class Q_GAMEPAD_EXPORT QGamepadBackendFactory
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static QStringList keys(const QString &pluginPath = QString());
|
static QStringList keys();
|
||||||
static QGamepadBackend *create(const QString &name, const QStringList &args, const QString &pluginPath = QString());
|
static QGamepadBackend *create(const QString &name, const QStringList &args);
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue