From afefdd5df374d8cfeca4614f4d25397fa6c997fe Mon Sep 17 00:00:00 2001 From: Lincoln Ramsay Date: Fri, 9 Mar 2012 13:50:24 +1000 Subject: 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 --- src/sensors/qsensormanager.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/sensors/qsensormanager.h') 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 -- cgit v1.2.3