diff options
author | Lorn Potter <lorn.potter@nokia.com> | 2011-11-11 10:46:31 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-14 06:54:31 +0100 |
commit | d95c5fee483816558246586c4621d96c84b224c0 (patch) | |
tree | 6d458feddc453baf26ef85130f8447e8d0d2a6ab /tests/auto/qsensor | |
parent | 1f20d5ef3e27981e2af2c6533656694ea3335678 (diff) |
Diffstat (limited to 'tests/auto/qsensor')
-rw-r--r-- | tests/auto/qsensor/test_sensorplugin.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/auto/qsensor/test_sensorplugin.cpp b/tests/auto/qsensor/test_sensorplugin.cpp index c501377a..c850b676 100644 --- a/tests/auto/qsensor/test_sensorplugin.cpp +++ b/tests/auto/qsensor/test_sensorplugin.cpp @@ -54,7 +54,7 @@ class TestSensorPlugin : public QObject, public QSensorBackendFactory { Q_OBJECT - Q_INTERFACES(QSensorPluginInterface QSensorChangesInterface) + Q_INTERFACES(QSensorPluginInterface:QFactoryInterface QSensorChangesInterface) public: void registerSensors() { @@ -63,6 +63,7 @@ public: if (recursive) return; recursive = true; + // This is bad code. It caused a crash due to recursively calling // loadPlugins() in qsensormanager.cpp (because loadPlugins() did // not set the pluginsLoaded flag soon enough). @@ -103,6 +104,8 @@ public: qWarning() << "Can't create backend" << sensor->identifier(); return 0; } + QStringList keys() const { return QStringList() << "test";} + }; REGISTER_STATIC_PLUGIN_V2(TestSensorPlugin) @@ -114,6 +117,8 @@ public: { qWarning() << "Loaded the LegacySensorPlugin"; } + QStringList keys() const { return QStringList() << "legacy";} + }; REGISTER_STATIC_PLUGIN_V1(LegacySensorPlugin) |