summaryrefslogtreecommitdiffstats
path: root/src/sensors/qsensormanager.h
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 /src/sensors/qsensormanager.h
parente24ce0c822bfb9bb38b8c9518e346ed2c4fa51e3 (diff)
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 'src/sensors/qsensormanager.h')
-rw-r--r--src/sensors/qsensormanager.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/sensors/qsensormanager.h b/src/sensors/qsensormanager.h
index 48a2ed46..f23f9e7e 100644
--- a/src/sensors/qsensormanager.h
+++ b/src/sensors/qsensormanager.h
@@ -43,7 +43,6 @@
#define QSENSORMANAGER_H
#include "qsensor.h"
-#include "qsensorplugindefs.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -80,6 +79,21 @@ protected:
~QSensorBackendFactory() {}
};
+// Static plugins have their own registration methods.
+// They can only register types. They cannot use the changes interface.
+#define REGISTER_STATIC_PLUGIN(pluginname) \
+ static QSensorPluginInterface *create_static_plugin_ ## pluginname()\
+ {\
+ return new pluginname;\
+ }\
+ static bool side_effect_sensor_backend_ ## pluginname ()\
+ {\
+ QSensorManager::registerStaticPlugin(create_static_plugin_ ## pluginname);\
+ return false;\
+ }\
+ /* This assignment calls the function above */\
+ static bool dummy_sensor_backend_ ## pluginname = side_effect_sensor_backend_ ## pluginname();
+
QT_END_NAMESPACE
QT_END_HEADER