diff options
author | Thomas McGuire <thomas.mcguire.qnx@kdab.com> | 2013-01-09 11:00:35 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-23 18:33:25 +0100 |
commit | 3b592cc270dfb124056c526a9a7784ff19edd028 (patch) | |
tree | b3b32b2d42bcae4d8e23b1253761e8e522b9089d /src/plugins/sensors/blackberry/main.cpp | |
parent | 78ad1fabee403ac910d29bb212cf0e3b9a670708 (diff) |
Add QHolsterSensor
This adds a new QHolsterSensor plus the assorted reading and filter
classes, as well as a QML API.
Also implement the Blackberry backend for it.
Change-Id: I42e76c21ee74a39a65629e7ab6d9a18f23eae4d4
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins/sensors/blackberry/main.cpp')
-rw-r--r-- | src/plugins/sensors/blackberry/main.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/plugins/sensors/blackberry/main.cpp b/src/plugins/sensors/blackberry/main.cpp index 7b4180a9..91efe4b0 100644 --- a/src/plugins/sensors/blackberry/main.cpp +++ b/src/plugins/sensors/blackberry/main.cpp @@ -43,6 +43,9 @@ #include "bbambientlightsensor.h" #include "bbcompass.h" #include "bbgyroscope.h" +#ifdef HAVE_HOLSTER_SENSOR +#include "bbholstersensor.h" +#endif #include "bbirproximitysensor.h" #include "bblightsensor.h" #include "bbmagnetometer.h" @@ -61,6 +64,9 @@ static const char *bbAltitmeterId = "bbAltimeter"; static const char *bbAmbientLightSensorId = "bbAmbientLightSensor"; static const char *bbCompassId = "bbCompass"; static const char *bbGyroscopeId = "bbGyroscope"; +#ifdef HAVE_HOLSTER_SENSOR +static const char *bbHolsterSensorId = "bbHolsterSensor"; +#endif static const char *bbIRProximitySensorId = "bbIRProximitySensor"; static const char *bbLightSensorId = "bbLightSensor"; static const char *bbMagnetometerId = "bbMagnetometer"; @@ -89,6 +95,10 @@ public: QSensorManager::registerBackend(QCompass::type, bbCompassId, this); if (sensorSupported(BbGyroscope::devicePath())) QSensorManager::registerBackend(QGyroscope::type, bbGyroscopeId, this); +#ifdef HAVE_HOLSTER_SENSOR + if (sensorSupported(BbHolsterSensor::devicePath())) + QSensorManager::registerBackend(QHolsterSensor::type, bbHolsterSensorId, this); +#endif if (sensorSupported(BbIRProximitySensor::devicePath())) QSensorManager::registerBackend(QIRProximitySensor::type, bbIRProximitySensorId, this); if (sensorSupported(BbLightSensor::devicePath())) @@ -120,6 +130,10 @@ public: backend = new BbCompass(sensor); if (sensor->identifier() == bbGyroscopeId) backend = new BbGyroscope(sensor); +#ifdef HAVE_HOLSTER_SENSOR + if (sensor->identifier() == bbHolsterSensorId) + backend = new BbHolsterSensor(sensor); +#endif if (sensor->identifier() == bbIRProximitySensorId) backend = new BbIRProximitySensor(sensor); if (sensor->identifier() == bbLightSensorId) |