summaryrefslogtreecommitdiff
path: root/tests/auto
diff options
context:
space:
mode:
authorLincoln Ramsay <lincoln.ramsay@nokia.com>2012-03-09 13:50:24 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-16 07:04:22 +0100
commitafefdd5df374d8cfeca4614f4d25397fa6c997fe (patch)
tree9d69cbd163ca937950b37e13a4a4bdb4b5fe61a7 /tests/auto
parente24ce0c822bfb9bb38b8c9518e346ed2c4fa51e3 (diff)
downloadqtsensors-afefdd5df374d8cfeca4614f4d25397fa6c997fe.tar.gz
Remove REGISTER_STATIC_PLUGIN_V2
This was never officially part of the public API. Remove it from public headers so that it is not accidentally used. This macro cannot be used with the new Qt plugins. There are 2 unit tests that use this mechanism and for this reason, loading of static, legacy plugins will continue but they will use internal logic to achieve this rather than a macro defined in a public header. Change-Id: I3fadcc1ca5c22ea0fc3660584ddba28271d18a89 Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qsensor/test_sensorplugin.cpp13
-rw-r--r--tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin.cpp10
-rw-r--r--tests/auto/qsensorgestures/plugins/test1/qtestsensorgestureplugindup.cpp10
3 files changed, 31 insertions, 2 deletions
diff --git a/tests/auto/qsensor/test_sensorplugin.cpp b/tests/auto/qsensor/test_sensorplugin.cpp
index ccd6714..6633bf8 100644
--- a/tests/auto/qsensor/test_sensorplugin.cpp
+++ b/tests/auto/qsensor/test_sensorplugin.cpp
@@ -108,6 +108,16 @@ public:
};
+// Logic stolen from qplugin.h
+#define REGISTER_STATIC_PLUGIN_V2(pluginname) \
+ static QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance() \
+ Q_PLUGIN_INSTANCE(pluginname) \
+ const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_##pluginname() { \
+ QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance, 0 }; \
+ return plugin; \
+ }\
+ Q_IMPORT_PLUGIN(pluginname)
+
REGISTER_STATIC_PLUGIN_V2(TestSensorPlugin)
class LegacySensorPlugin : public QSensorPluginInterface
@@ -121,7 +131,6 @@ public:
};
-REGISTER_STATIC_PLUGIN_V1(LegacySensorPlugin)
+REGISTER_STATIC_PLUGIN(LegacySensorPlugin)
#include "test_sensorplugin.moc"
-
diff --git a/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin.cpp b/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin.cpp
index 72df200..eb245c0 100644
--- a/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin.cpp
+++ b/tests/auto/qsensorgestures/plugins/test/qtestsensorgestureplugin.cpp
@@ -107,4 +107,14 @@ QString QTestSensorGesturePlugin::name() const
return "TestGestures";
}
+// Logic stolen from qplugin.h
+#define REGISTER_STATIC_PLUGIN_V2(pluginname) \
+ static QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance() \
+ Q_PLUGIN_INSTANCE(pluginname) \
+ const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_##pluginname() { \
+ QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance, 0 }; \
+ return plugin; \
+ }\
+ Q_IMPORT_PLUGIN(pluginname)
+
REGISTER_STATIC_PLUGIN_V2(QTestSensorGesturePlugin)
diff --git a/tests/auto/qsensorgestures/plugins/test1/qtestsensorgestureplugindup.cpp b/tests/auto/qsensorgestures/plugins/test1/qtestsensorgestureplugindup.cpp
index 4413f9e..26bb9ae 100644
--- a/tests/auto/qsensorgestures/plugins/test1/qtestsensorgestureplugindup.cpp
+++ b/tests/auto/qsensorgestures/plugins/test1/qtestsensorgestureplugindup.cpp
@@ -105,4 +105,14 @@ QString QTestSensorGestureDupPlugin::name() const
return "TestGesturesDup";
}
+// Logic stolen from qplugin.h
+#define REGISTER_STATIC_PLUGIN_V2(pluginname) \
+ static QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance() \
+ Q_PLUGIN_INSTANCE(pluginname) \
+ const QT_PREPEND_NAMESPACE(QStaticPlugin) qt_static_plugin_##pluginname() { \
+ QT_PREPEND_NAMESPACE(QStaticPlugin) plugin = { qt_plugin_instance, 0 }; \
+ return plugin; \
+ }\
+ Q_IMPORT_PLUGIN(pluginname)
+
REGISTER_STATIC_PLUGIN_V2(QTestSensorGestureDupPlugin)