From 20769d97920674d9b7480d1f2305315dcd9d2819 Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Fri, 29 Jun 2012 10:39:22 +0200 Subject: Blackberry: Add ambient light sensor support Change-Id: I119c5864599e206795522be485c4c218f983cfb9 Reviewed-by: Adam Parco Reviewed-by: Lorn Potter Reviewed-by: Sean Harmer --- src/plugins/sensors/blackberry/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/plugins/sensors/blackberry/main.cpp') diff --git a/src/plugins/sensors/blackberry/main.cpp b/src/plugins/sensors/blackberry/main.cpp index c0d1f1d9..e5827760 100644 --- a/src/plugins/sensors/blackberry/main.cpp +++ b/src/plugins/sensors/blackberry/main.cpp @@ -40,6 +40,7 @@ ****************************************************************************/ #include "bbaccelerometer.h" #include "bbaltimeter.h" +#include "bbambientlightsensor.h" #include "bbcompass.h" #include "bbgyroscope.h" #include "bbirproximitysensor.h" @@ -56,6 +57,7 @@ static const char *bbAccelerometerId = "bbAccelerometer"; static const char *bbAltitmeterId = "bbAltimeter"; +static const char *bbAmbientLightSensorId = "bbAmbientLightSensor"; static const char *bbCompassId = "bbCompass"; static const char *bbGyroscopeId = "bbGyroscope"; static const char *bbIRProximitySensorId = "bbIRProximitySensor"; @@ -80,6 +82,8 @@ public: QSensorManager::registerBackend(QAccelerometer::type, bbAccelerometerId, this); if (sensorSupported(BbAltimeter::devicePath())) QSensorManager::registerBackend("BbAltimeter", bbAltitmeterId, this); + if (sensorSupported(BbAmbientLightSensor::devicePath())) + QSensorManager::registerBackend(QAmbientLightSensor::type, bbAmbientLightSensorId, this); if (sensorSupported(BbCompass::devicePath())) QSensorManager::registerBackend(QCompass::type, bbCompassId, this); if (sensorSupported(BbGyroscope::devicePath())) @@ -109,6 +113,8 @@ public: backend = new BbAccelerometer(sensor); if (sensor->identifier() == bbAltitmeterId) backend = new BbAltimeter(sensor); + if (sensor->identifier() == bbAmbientLightSensorId) + backend = new BbAmbientLightSensor(sensor); if (sensor->identifier() == bbCompassId) backend = new BbCompass(sensor); if (sensor->identifier() == bbGyroscopeId) -- cgit v1.2.3