diff options
author | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2012-03-14 16:33:19 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-16 08:02:30 +0100 |
commit | 8d25a4a58c47431c589d8cbbc82e442360cf7e63 (patch) | |
tree | 14d4c0f123e602e8528298346f72df5debd2936c /tests | |
parent | b6d87d1b5141987452bc30e8b1d4115998ba6fd9 (diff) | |
download | qtsensors-8d25a4a58c47431c589d8cbbc82e442360cf7e63.tar.gz |
Use the new plugin mechanism for Sensors and SensorGestures
Plugins no longer use QFactoryInterface or Q_EXPORT_PLUGIN. Instead,
Q_PLUGIN_METADATA is used.
Meta-data is provided through a .json file that is embedded into the
plugin by moc.
For now, this meta-data is not actually used because both sensors
and gestures use a dynamic registration mechanism.
Change-Id: Ic82657e2ba5768127e13f7411ca51f60772781d8
Reviewed-by: Lincoln Ramsay <lincoln.ramsay@nokia.com>
Diffstat (limited to 'tests')
7 files changed, 11 insertions, 11 deletions
diff --git a/tests/auto/qsensor/test_sensorplugin.cpp b/tests/auto/qsensor/test_sensorplugin.cpp index 08d6cd3..6d78e90 100644 --- a/tests/auto/qsensor/test_sensorplugin.cpp +++ b/tests/auto/qsensor/test_sensorplugin.cpp @@ -54,7 +54,8 @@ class TestSensorPlugin : public QObject, public QSensorBackendFactory { Q_OBJECT - Q_INTERFACES(QSensorPluginInterface:QFactoryInterface QSensorChangesInterface) + //Q_PLUGIN_METADATA(IID "com.nokia.Qt.QSensorPluginInterface/1.0" FILE "plugin.json") + Q_INTERFACES(QSensorPluginInterface QSensorChangesInterface) public: void registerSensors() { @@ -104,8 +105,6 @@ public: qWarning() << "Can't create backend" << sensor->identifier(); return 0; } - QStringList keys() const { return QStringList() << "test";} - }; // Logic stolen from qplugin.h diff --git a/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin_p.h b/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin_p.h index bb1fd45..cf1ab32 100644 --- a/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin_p.h +++ b/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin_p.h @@ -48,7 +48,8 @@ class QTestSensorGesturePlugin : public QObject, public QSensorGesturePluginInterface { Q_OBJECT - Q_INTERFACES(QSensorGesturePluginInterface:QFactoryInterface) + //Q_PLUGIN_METADATA(IID "com.Nokia.QSensorGesturePluginInterface" FILE "plugin.json") + Q_INTERFACES(QSensorGesturePluginInterface) public: explicit QTestSensorGesturePlugin(); diff --git a/tests/auto/qsensorgestures/plugins/test1/qtestsensorgestureplugindup.h b/tests/auto/qsensorgestures/plugins/test1/qtestsensorgestureplugindup.h index 1ab5e44..18f4577 100644 --- a/tests/auto/qsensorgestures/plugins/test1/qtestsensorgestureplugindup.h +++ b/tests/auto/qsensorgestures/plugins/test1/qtestsensorgestureplugindup.h @@ -48,7 +48,8 @@ class QTestSensorGestureDupPlugin : public QObject, public QSensorGesturePluginInterface { Q_OBJECT - Q_INTERFACES(QSensorGesturePluginInterface:QFactoryInterface) + //Q_PLUGIN_METADATA(IID "com.Nokia.QSensorGesturePluginInterface" FILE "plugin.json") + Q_INTERFACES(QSensorGesturePluginInterface) public: explicit QTestSensorGestureDupPlugin(); diff --git a/tests/auto/sensors2qmlapi/qbackends.h b/tests/auto/sensors2qmlapi/qbackends.h index 90cc256..368de18 100644 --- a/tests/auto/sensors2qmlapi/qbackends.h +++ b/tests/auto/sensors2qmlapi/qbackends.h @@ -55,7 +55,8 @@ class TestSensorPlugin : public QObject, public QSensorBackendFactory { Q_OBJECT - Q_INTERFACES(QSensorPluginInterface:QFactoryInterface QSensorChangesInterface) + //Q_PLUGIN_METADATA(IID "com.nokia.Qt.QSensorPluginInterface/1.0" FILE "plugin.json") + Q_INTERFACES(QSensorPluginInterface QSensorChangesInterface) public: void registerSensors() { @@ -95,7 +96,6 @@ public: qWarning() << "Can't create backend" << sensor->identifier(); return 0; } - QStringList keys() const { return QStringList() << "test";} public: static QDeclAccelerometer* stAccel; static QDeclAmbientLightSensor* stAbl; diff --git a/tests/auto/sensors2qmlapi/qtemplategestureplugin.cpp b/tests/auto/sensors2qmlapi/qtemplategestureplugin.cpp index 27a49dd..ab0a908 100644 --- a/tests/auto/sensors2qmlapi/qtemplategestureplugin.cpp +++ b/tests/auto/sensors2qmlapi/qtemplategestureplugin.cpp @@ -76,6 +76,3 @@ QList <QSensorGestureRecognizer *> QTemplateGesturePlugin::createRecognizers() return recognizers; } - -Q_EXPORT_PLUGIN2(QTemplateGestureRecognizer, QTemplateGesturePlugin) - diff --git a/tests/auto/sensors2qmlapi/qtemplategestureplugin.h b/tests/auto/sensors2qmlapi/qtemplategestureplugin.h index f396ce0..cef952b 100644 --- a/tests/auto/sensors2qmlapi/qtemplategestureplugin.h +++ b/tests/auto/sensors2qmlapi/qtemplategestureplugin.h @@ -50,7 +50,8 @@ class QTemplateGesturePlugin : public QObject, public QSensorGesturePluginInterface { Q_OBJECT - Q_INTERFACES(QSensorGesturePluginInterface:QFactoryInterface) + //Q_PLUGIN_METADATA(IID "com.Nokia.QSensorGesturePluginInterface" FILE "plugin.json") + Q_INTERFACES(QSensorGesturePluginInterface) public: explicit QTemplateGesturePlugin(); ~QTemplateGesturePlugin(); diff --git a/tests/auto/sensors2qmlapi/sensors2qmlapi.pro b/tests/auto/sensors2qmlapi/sensors2qmlapi.pro index 2804360..8144692 100644 --- a/tests/auto/sensors2qmlapi/sensors2qmlapi.pro +++ b/tests/auto/sensors2qmlapi/sensors2qmlapi.pro @@ -26,3 +26,4 @@ HEADERS += qdeclaccelerometer.h \ ./../../../src/imports/sensors2/qsensor2common.h \ qtemplategestureplugin.h \ qtemplaterecognizer.h + |