From c6fd02d70e22d497658153abbd9fcf3176b550ca Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Tue, 4 May 2010 14:26:43 +0200 Subject: add parameter support for platform integration plugins --- src/gui/kernel/qplatformintegrationfactory_lite.cpp | 5 +++-- src/gui/kernel/qplatformintegrationplugin_lite.h | 4 ++-- src/plugins/platforms/directfb/main.cpp | 5 +++-- src/plugins/platforms/linuxfb/main.cpp | 5 +++-- src/plugins/platforms/minimal/main.cpp | 5 +++-- src/plugins/platforms/qvfb/main.cpp | 5 +++-- src/plugins/platforms/testlite/main.cpp | 5 +++-- src/plugins/platforms/vnc/main.cpp | 5 +++-- 8 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/gui/kernel/qplatformintegrationfactory_lite.cpp b/src/gui/kernel/qplatformintegrationfactory_lite.cpp index 7f650e9..9a00dea 100644 --- a/src/gui/kernel/qplatformintegrationfactory_lite.cpp +++ b/src/gui/kernel/qplatformintegrationfactory_lite.cpp @@ -57,12 +57,13 @@ Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, QPlatformIntegration *QPlatformIntegrationFactory::create(const QString& key) { QPlatformIntegration *ret = 0; - QString platform = key.toLower(); + QStringList paramList = key.split(QLatin1Char(':')); + QString platform = paramList.takeFirst().toLower(); qDebug() << loader()->keys(); #if !defined(QT_NO_LIBRARY) && !defined(QT_NO_SETTINGS) if (QPlatformIntegrationFactoryInterface *factory = qobject_cast(loader()->instance(platform))) - ret = factory->create(platform); + ret = factory->create(platform, paramList); #endif return ret; diff --git a/src/gui/kernel/qplatformintegrationplugin_lite.h b/src/gui/kernel/qplatformintegrationplugin_lite.h index 0e116f2..9c37cf7 100644 --- a/src/gui/kernel/qplatformintegrationplugin_lite.h +++ b/src/gui/kernel/qplatformintegrationplugin_lite.h @@ -66,7 +66,7 @@ class QPlatformIntegration; struct QPlatformIntegrationFactoryInterface : public QFactoryInterface { - virtual QPlatformIntegration *create(const QString &key) = 0; + virtual QPlatformIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; #define QPlatformIntegrationFactoryInterface_iid "com.nokia.Qt.QPlatformIntegrationFactoryInterface" @@ -82,7 +82,7 @@ public: ~QPlatformIntegrationPlugin(); virtual QStringList keys() const = 0; - virtual QPlatformIntegration *create(const QString &key) = 0; + virtual QPlatformIntegration *create(const QString &key, const QStringList ¶mList) = 0; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/directfb/main.cpp b/src/plugins/platforms/directfb/main.cpp index 9c7bcf6..f4ece32 100644 --- a/src/plugins/platforms/directfb/main.cpp +++ b/src/plugins/platforms/directfb/main.cpp @@ -48,7 +48,7 @@ class QDirectFbIntegrationPlugin : public QPlatformIntegrationPlugin { public: QStringList keys() const; - QPlatformIntegration *create(const QString&); + QPlatformIntegration *create(const QString&, const QStringList&); }; QStringList QDirectFbIntegrationPlugin::keys() const @@ -58,8 +58,9 @@ QStringList QDirectFbIntegrationPlugin::keys() const return list; } -QPlatformIntegration * QDirectFbIntegrationPlugin::create(const QString& system) +QPlatformIntegration * QDirectFbIntegrationPlugin::create(const QString& system, const QStringList& paramList) { + Q_UNUSED(paramList); if (system.toLower() == "directfb") return new QDirectFbIntegration; diff --git a/src/plugins/platforms/linuxfb/main.cpp b/src/plugins/platforms/linuxfb/main.cpp index 65569ac..c5f7fe0 100644 --- a/src/plugins/platforms/linuxfb/main.cpp +++ b/src/plugins/platforms/linuxfb/main.cpp @@ -48,7 +48,7 @@ class QLinuxFbIntegrationPlugin : public QPlatformIntegrationPlugin { public: QStringList keys() const; - QPlatformIntegration *create(const QString&); + QPlatformIntegration *create(const QString&, const QStringList&); }; QStringList QLinuxFbIntegrationPlugin::keys() const @@ -58,8 +58,9 @@ QStringList QLinuxFbIntegrationPlugin::keys() const return list; } -QPlatformIntegration* QLinuxFbIntegrationPlugin::create(const QString& system) +QPlatformIntegration* QLinuxFbIntegrationPlugin::create(const QString& system, const QStringList& paramList) { + Q_UNUSED(paramList); if (system.toLower() == "linuxfb") return new QLinuxFbIntegration; diff --git a/src/plugins/platforms/minimal/main.cpp b/src/plugins/platforms/minimal/main.cpp index 4958468..a4d646d 100644 --- a/src/plugins/platforms/minimal/main.cpp +++ b/src/plugins/platforms/minimal/main.cpp @@ -48,7 +48,7 @@ class QMinimalIntegrationPlugin : public QPlatformIntegrationPlugin { public: QStringList keys() const; - QPlatformIntegration *create(const QString&); + QPlatformIntegration *create(const QString&, const QStringList&); }; QStringList QMinimalIntegrationPlugin::keys() const @@ -58,8 +58,9 @@ QStringList QMinimalIntegrationPlugin::keys() const return list; } -QPlatformIntegration *QMinimalIntegrationPlugin::create(const QString& system) +QPlatformIntegration *QMinimalIntegrationPlugin::create(const QString& system, const QStringList& paramList) { + Q_UNUSED(paramList); if (system.toLower() == "minimal") return new QMinimalIntegration; diff --git a/src/plugins/platforms/qvfb/main.cpp b/src/plugins/platforms/qvfb/main.cpp index 409f11c..206ece8 100644 --- a/src/plugins/platforms/qvfb/main.cpp +++ b/src/plugins/platforms/qvfb/main.cpp @@ -49,7 +49,7 @@ class QVFbIntegrationPlugin : public QPlatformIntegrationPlugin { public: QStringList keys() const; - QPlatformIntegration *create(const QString&); + QPlatformIntegration *create(const QString&, const QStringList&); }; QStringList QVFbIntegrationPlugin::keys() const @@ -59,8 +59,9 @@ QStringList QVFbIntegrationPlugin::keys() const return list; } -QPlatformIntegration* QVFbIntegrationPlugin::create(const QString& system) +QPlatformIntegration* QVFbIntegrationPlugin::create(const QString& system, const QStringList& paramList) { + Q_UNUSED(paramList); if (system.toLower() == "qvfb") return new QVFbIntegration; diff --git a/src/plugins/platforms/testlite/main.cpp b/src/plugins/platforms/testlite/main.cpp index 5f631f0..2f6aa8b 100644 --- a/src/plugins/platforms/testlite/main.cpp +++ b/src/plugins/platforms/testlite/main.cpp @@ -48,7 +48,7 @@ class QTestLiteIntegrationPlugin : public QPlatformIntegrationPlugin { public: QStringList keys() const; - QPlatformIntegration *create(const QString&); + QPlatformIntegration *create(const QString&, const QStringList&); }; QStringList QTestLiteIntegrationPlugin::keys() const @@ -61,8 +61,9 @@ QStringList QTestLiteIntegrationPlugin::keys() const return list; } -QPlatformIntegration* QTestLiteIntegrationPlugin::create(const QString& system) +QPlatformIntegration* QTestLiteIntegrationPlugin::create(const QString& system, const QStringList& paramList) { + Q_UNUSED(paramList); if (system.toLower() == "testlite") return new QTestLiteIntegration; #ifndef QT_NO_OPENGL diff --git a/src/plugins/platforms/vnc/main.cpp b/src/plugins/platforms/vnc/main.cpp index 775259b..c66029c 100644 --- a/src/plugins/platforms/vnc/main.cpp +++ b/src/plugins/platforms/vnc/main.cpp @@ -49,7 +49,7 @@ class QVNCIntegrationPlugin : public QPlatformIntegrationPlugin { public: QStringList keys() const; - QPlatformIntegration *create(const QString&); + QPlatformIntegration *create(const QString&, const QStringList &); }; QStringList QVNCIntegrationPlugin::keys() const @@ -59,8 +59,9 @@ QStringList QVNCIntegrationPlugin::keys() const return list; } -QPlatformIntegration* QVNCIntegrationPlugin::create(const QString& system) +QPlatformIntegration* QVNCIntegrationPlugin::create(const QString& system, const QStringList& paramList) { + Q_UNUSED(paramList); if (system.toLower() == "vnc") return new QVNCIntegration; -- cgit v0.12