summaryrefslogtreecommitdiffstats
path: root/src/sensors/qsensormanager.h
diff options
context:
space:
mode:
authorLincoln Ramsay <lincoln.ramsay@nokia.com>2012-02-17 11:45:05 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-17 06:12:24 +0100
commit01a842c2fbfb5a74d61481165cc6d722de7c49ba (patch)
treebe27924422bc00f965ab3244b07256bdc00c50f3 /src/sensors/qsensormanager.h
parentfbc2e2ca805b97bdbef4a3b6b6a276215ba668df (diff)
Update REGISTER_STATIC_PLUGIN_V2 (compile)
Ideally, this macro would only consist of a Q_EXPORT_PLUGIN / Q_IMPORT_PLUGIN combination but there is no 'static' version of Q_EXPORT_PLUGIN available unless we're a static build of Qt. Thus, this macro duplicates the logic from the correct Q_EXPORT_PLUGIN macro here. Use the new code so that we can compile apps that use REGISTER_STATIC_PLUGIN_V2 (like the unit test). Using an ifdef so we don't break people who haven't updated qtbase yet. Refactor the headers so we only have 1 copy of this macro. Change-Id: Id8c69833029bdd54b66d24dea878b0603b0cb6e9 Reviewed-by: Zsolt Simon <zsolt.simon@nokia.com>
Diffstat (limited to 'src/sensors/qsensormanager.h')
-rw-r--r--src/sensors/qsensormanager.h27
1 files changed, 1 insertions, 26 deletions
diff --git a/src/sensors/qsensormanager.h b/src/sensors/qsensormanager.h
index 27ff6c82..0cd151d1 100644
--- a/src/sensors/qsensormanager.h
+++ b/src/sensors/qsensormanager.h
@@ -43,6 +43,7 @@
#define QSENSORMANAGER_H
#include "qsensor.h"
+#include "qsensorplugindefs.h"
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -77,32 +78,6 @@ protected:
~QSensorBackendFactory() {}
};
-// The default is for legacy static plugins
-// This will change to Qt-style static plugins in 1.3
-#define REGISTER_STATIC_PLUGIN(pluginname) \
- REGISTER_STATIC_PLUGIN_V1(pluginname)
-
-// Legacy static plugins have their own registration methods.
-// They can only register types. They cannot use the changes interface.
-#define REGISTER_STATIC_PLUGIN_V1(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-style static plugins use macros from Qt.
-// They are handled just like regular plugins.
-#define REGISTER_STATIC_PLUGIN_V2(pluginname) \
- QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance_##pluginname() Q_PLUGIN_INSTANCE(pluginname)\
- Q_IMPORT_PLUGIN(pluginname)
-
QT_END_NAMESPACE
QT_END_HEADER