From 0b69385e420d55995c73f8f490f02f4565088a23 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sun, 27 May 2012 04:57:31 +0200 Subject: [PATCH] Remove the QFactoryInterface dependency from platform plugins Change-Id: I4010e59dcd8a790e06bb9a0ccf3cc9a5c7737ed1 Reviewed-by: Thiago Macieira --- src/gui/kernel/qplatformintegrationfactory_qpa.cpp | 4 ++-- src/gui/kernel/qplatformintegrationplugin.h | 11 +---------- src/gui/kernel/qplatformthemefactory_qpa.cpp | 4 ++-- src/gui/kernel/qplatformthemeplugin.h | 12 +----------- src/plugins/platforms/cocoa/main.mm | 8 -------- src/plugins/platforms/directfb/main.cpp | 9 --------- src/plugins/platforms/eglfs/main.cpp | 8 -------- src/plugins/platforms/kms/main.cpp | 8 -------- src/plugins/platforms/linuxfb/main.cpp | 8 -------- src/plugins/platforms/minimal/main.cpp | 8 -------- src/plugins/platforms/openwfd/main.cpp | 8 -------- src/plugins/platforms/qnx/main.cpp | 7 ------- src/plugins/platforms/qnx/main.h | 1 - src/plugins/platforms/windows/main.cpp | 6 ------ src/plugins/platforms/xcb/main.cpp | 8 -------- 15 files changed, 6 insertions(+), 104 deletions(-) diff --git a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp index 3b05742..886f50b 100644 --- a/src/gui/kernel/qplatformintegrationfactory_qpa.cpp +++ b/src/gui/kernel/qplatformintegrationfactory_qpa.cpp @@ -66,10 +66,10 @@ QPlatformIntegration *QPlatformIntegrationFactory::create(const QString& key, co // Try loading the plugin from platformPluginPath first: if (!platformPluginPath.isEmpty()) { QCoreApplication::addLibraryPath(platformPluginPath); - if (QPlatformIntegration *ret = qLoadPlugin1(directLoader(), platform, paramList)) + if (QPlatformIntegration *ret = qLoadPlugin1(directLoader(), platform, paramList)) return ret; } - if (QPlatformIntegration *ret = qLoadPlugin1(loader(), platform, paramList)) + if (QPlatformIntegration *ret = qLoadPlugin1(loader(), platform, paramList)) return ret; #endif return 0; diff --git a/src/gui/kernel/qplatformintegrationplugin.h b/src/gui/kernel/qplatformintegrationplugin.h index 8b36a7d..8990668 100644 --- a/src/gui/kernel/qplatformintegrationplugin.h +++ b/src/gui/kernel/qplatformintegrationplugin.h @@ -61,24 +61,15 @@ QT_BEGIN_NAMESPACE class QPlatformIntegration; -struct QPlatformIntegrationFactoryInterface : public QFactoryInterface -{ - virtual QPlatformIntegration *create(const QString &key, const QStringList ¶mList) = 0; -}; - #define QPlatformIntegrationFactoryInterface_iid "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" -Q_DECLARE_INTERFACE(QPlatformIntegrationFactoryInterface, QPlatformIntegrationFactoryInterface_iid) - -class Q_GUI_EXPORT QPlatformIntegrationPlugin : public QObject, public QPlatformIntegrationFactoryInterface +class Q_GUI_EXPORT QPlatformIntegrationPlugin : public QObject { Q_OBJECT - Q_INTERFACES(QPlatformIntegrationFactoryInterface:QFactoryInterface) public: explicit QPlatformIntegrationPlugin(QObject *parent = 0); ~QPlatformIntegrationPlugin(); - virtual QStringList keys() const = 0; virtual QPlatformIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; diff --git a/src/gui/kernel/qplatformthemefactory_qpa.cpp b/src/gui/kernel/qplatformthemefactory_qpa.cpp index c809a7f..cc20399 100644 --- a/src/gui/kernel/qplatformthemefactory_qpa.cpp +++ b/src/gui/kernel/qplatformthemefactory_qpa.cpp @@ -66,10 +66,10 @@ QPlatformTheme *QPlatformThemeFactory::create(const QString& key, const QString // Try loading the plugin from platformPluginPath first: if (!platformPluginPath.isEmpty()) { QCoreApplication::addLibraryPath(platformPluginPath); - if (QPlatformTheme *ret = qLoadPlugin1(directLoader(), platform, paramList)) + if (QPlatformTheme *ret = qLoadPlugin1(directLoader(), platform, paramList)) return ret; } - if (QPlatformTheme *ret = qLoadPlugin1(loader(), platform, paramList)) + if (QPlatformTheme *ret = qLoadPlugin1(loader(), platform, paramList)) return ret; #endif return 0; diff --git a/src/gui/kernel/qplatformthemeplugin.h b/src/gui/kernel/qplatformthemeplugin.h index 970eb36..cc7bd76 100644 --- a/src/gui/kernel/qplatformthemeplugin.h +++ b/src/gui/kernel/qplatformthemeplugin.h @@ -58,27 +58,17 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE - class QPlatformTheme; -struct QPlatformThemeFactoryInterface : public QFactoryInterface -{ - virtual QPlatformTheme *create(const QString &key, const QStringList ¶mList) = 0; -}; - #define QPlatformThemeFactoryInterface_iid "org.qt-project.Qt.QPlatformThemeFactoryInterface" -Q_DECLARE_INTERFACE(QPlatformThemeFactoryInterface, QPlatformThemeFactoryInterface_iid) - -class Q_GUI_EXPORT QPlatformThemePlugin : public QObject, public QPlatformThemeFactoryInterface +class Q_GUI_EXPORT QPlatformThemePlugin : public QObject { Q_OBJECT - Q_INTERFACES(QPlatformThemeFactoryInterface:QFactoryInterface) public: explicit QPlatformThemePlugin(QObject *parent = 0); ~QPlatformThemePlugin(); - virtual QStringList keys() const = 0; virtual QPlatformTheme *create(const QString &key, const QStringList ¶mList) = 0; }; diff --git a/src/plugins/platforms/cocoa/main.mm b/src/plugins/platforms/cocoa/main.mm index fc17bd3..35546ec 100644 --- a/src/plugins/platforms/cocoa/main.mm +++ b/src/plugins/platforms/cocoa/main.mm @@ -53,17 +53,9 @@ class QCocoaIntegrationPlugin : public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "cocoa.json") public: - QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); }; -QStringList QCocoaIntegrationPlugin::keys() const -{ - QStringList list; - list << "Cocoa"; - return list; -} - QPlatformIntegration * QCocoaIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); diff --git a/src/plugins/platforms/directfb/main.cpp b/src/plugins/platforms/directfb/main.cpp index 86af137..cc9fcf6 100644 --- a/src/plugins/platforms/directfb/main.cpp +++ b/src/plugins/platforms/directfb/main.cpp @@ -60,18 +60,9 @@ class QDirectFbIntegrationPlugin : public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "directfb.json") public: - QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); }; -QStringList QDirectFbIntegrationPlugin::keys() const -{ - QStringList list; - list << "directfb"; - QT_EGL_BACKEND_STRING(list); - return list; -} - QPlatformIntegration * QDirectFbIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); diff --git a/src/plugins/platforms/eglfs/main.cpp b/src/plugins/platforms/eglfs/main.cpp index 9680d0e..de3fe04 100644 --- a/src/plugins/platforms/eglfs/main.cpp +++ b/src/plugins/platforms/eglfs/main.cpp @@ -49,17 +49,9 @@ class QEglFSIntegrationPlugin : public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "eglfs.json") public: - QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); }; -QStringList QEglFSIntegrationPlugin::keys() const -{ - QStringList list; - list << "EglFS"; - return list; -} - QPlatformIntegration* QEglFSIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); diff --git a/src/plugins/platforms/kms/main.cpp b/src/plugins/platforms/kms/main.cpp index c1baaf3..73a7029 100644 --- a/src/plugins/platforms/kms/main.cpp +++ b/src/plugins/platforms/kms/main.cpp @@ -49,17 +49,9 @@ class QKmsIntegrationPlugin : public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "kms.json") public: - QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); }; -QStringList QKmsIntegrationPlugin::keys() const -{ - QStringList list; - list << "kms"; - return list; -} - QPlatformIntegration *QKmsIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); diff --git a/src/plugins/platforms/linuxfb/main.cpp b/src/plugins/platforms/linuxfb/main.cpp index f670b6f..59a3864 100644 --- a/src/plugins/platforms/linuxfb/main.cpp +++ b/src/plugins/platforms/linuxfb/main.cpp @@ -47,17 +47,9 @@ QT_BEGIN_NAMESPACE class QLinuxFbIntegrationPlugin : public QPlatformIntegrationPlugin { public: - QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); }; -QStringList QLinuxFbIntegrationPlugin::keys() const -{ - QStringList list; - list << "LinuxFb"; - return list; -} - QPlatformIntegration* QLinuxFbIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); diff --git a/src/plugins/platforms/minimal/main.cpp b/src/plugins/platforms/minimal/main.cpp index 9ac75e1..f5649c1 100644 --- a/src/plugins/platforms/minimal/main.cpp +++ b/src/plugins/platforms/minimal/main.cpp @@ -50,17 +50,9 @@ class QMinimalIntegrationPlugin : public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "minimal.json") public: - QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); }; -QStringList QMinimalIntegrationPlugin::keys() const -{ - QStringList list; - list << "Minimal"; - return list; -} - QPlatformIntegration *QMinimalIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); diff --git a/src/plugins/platforms/openwfd/main.cpp b/src/plugins/platforms/openwfd/main.cpp index 0d9508d..2db53ea 100644 --- a/src/plugins/platforms/openwfd/main.cpp +++ b/src/plugins/platforms/openwfd/main.cpp @@ -47,17 +47,9 @@ QT_BEGIN_NAMESPACE class QOpenWFDIntegrationPlugin : public QPlatformIntegrationPlugin { public: - QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); }; -QStringList QOpenWFDIntegrationPlugin::keys() const -{ - QStringList list; - list << "OpenWFD"; - return list; -} - QPlatformIntegration* QOpenWFDIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); diff --git a/src/plugins/platforms/qnx/main.cpp b/src/plugins/platforms/qnx/main.cpp index 2dbff09..2feab12 100644 --- a/src/plugins/platforms/qnx/main.cpp +++ b/src/plugins/platforms/qnx/main.cpp @@ -44,13 +44,6 @@ QT_BEGIN_NAMESPACE -QStringList QQnxIntegrationPlugin::keys() const -{ - QStringList list; - list << QLatin1String("qnx"); - return list; -} - QPlatformIntegration *QQnxIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); diff --git a/src/plugins/platforms/qnx/main.h b/src/plugins/platforms/qnx/main.h index 4033a29..b4e229e 100644 --- a/src/plugins/platforms/qnx/main.h +++ b/src/plugins/platforms/qnx/main.h @@ -48,7 +48,6 @@ class QQnxIntegrationPlugin : public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "qnx.json") public: - QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); }; diff --git a/src/plugins/platforms/windows/main.cpp b/src/plugins/platforms/windows/main.cpp index b552e53..8bc603b 100644 --- a/src/plugins/platforms/windows/main.cpp +++ b/src/plugins/platforms/windows/main.cpp @@ -107,15 +107,9 @@ class QWindowsIntegrationPlugin : public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "windows.json") public: - QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); }; -QStringList QWindowsIntegrationPlugin::keys() const -{ - return QStringList(QStringLiteral("windows")); -} - QPlatformIntegration *QWindowsIntegrationPlugin::create(const QString& system, const QStringList& paramList) { Q_UNUSED(paramList); diff --git a/src/plugins/platforms/xcb/main.cpp b/src/plugins/platforms/xcb/main.cpp index 4474a47..eaeccfb 100644 --- a/src/plugins/platforms/xcb/main.cpp +++ b/src/plugins/platforms/xcb/main.cpp @@ -49,17 +49,9 @@ class QXcbIntegrationPlugin : public QPlatformIntegrationPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QPlatformIntegrationFactoryInterface" FILE "xcb.json") public: - QStringList keys() const; QPlatformIntegration *create(const QString&, const QStringList&); }; -QStringList QXcbIntegrationPlugin::keys() const -{ - QStringList list; - list << "xcb"; - return list; -} - QPlatformIntegration* QXcbIntegrationPlugin::create(const QString& system, const QStringList& parameters) { if (system.toLower() == "xcb") -- 2.7.4