summaryrefslogtreecommitdiff
path: root/src/plugins/sensors/blackberry/bborientationsensor.cpp
diff options
context:
space:
mode:
authorSergio Ahumada <sergio.ahumada@digia.com>2013-03-19 11:05:55 +0100
committerSergio Ahumada <sergio.ahumada@digia.com>2013-03-19 11:06:33 +0100
commit50c16eab20a6d9884ab3149ef59137a10de63e6d (patch)
tree2684617d911514147283516ddd15803a4049da61 /src/plugins/sensors/blackberry/bborientationsensor.cpp
parentd2cafb8506b798bad7fa56f19557dd6e1cb25cd7 (diff)
parent879e5536b033302b2ad976750cd2351674e161d6 (diff)
downloadqtsensors-50c16eab20a6d9884ab3149ef59137a10de63e6d.tar.gz
Merge branch 'dev' into stable
This starts Qt 5.1 release cycle Change-Id: Idce0f9b94f9e585abfb6903f554500a06f4f8aaa
Diffstat (limited to 'src/plugins/sensors/blackberry/bborientationsensor.cpp')
-rw-r--r--src/plugins/sensors/blackberry/bborientationsensor.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/plugins/sensors/blackberry/bborientationsensor.cpp b/src/plugins/sensors/blackberry/bborientationsensor.cpp
index 68ed735..3d9d120 100644
--- a/src/plugins/sensors/blackberry/bborientationsensor.cpp
+++ b/src/plugins/sensors/blackberry/bborientationsensor.cpp
@@ -44,6 +44,9 @@ BbOrientationSensor::BbOrientationSensor(QSensor *sensor)
: BbSensorBackend<QOrientationReading>(devicePath(), SENSOR_TYPE_ORIENTATION, sensor)
{
setDescription(QLatin1String("Device orientation"));
+
+ // Orientation rarely changes, so enable skipping of duplicates by default
+ sensor->setSkipDuplicates(true);
}
QString BbOrientationSensor::devicePath()
@@ -51,19 +54,6 @@ QString BbOrientationSensor::devicePath()
return QLatin1String("/dev/sensor/orientation");
}
-void BbOrientationSensor::start()
-{
- BbSensorBackend<QOrientationReading>::start();
-
- // Orientation rarely changes, so enable skiping of duplicates
- sensor_devctl_skipdupevent_u deviceSkip;
- deviceSkip.tx.enable = 1;
- const int result = devctl(deviceFile().handle(), DCMD_SENSOR_SKIPDUPEVENT, &deviceSkip,
- sizeof(deviceSkip), NULL);
- if (result != EOK)
- perror("Enabling duplicate skipping for orientation sensor failed");
-}
-
void BbOrientationSensor::additionalDeviceInit()
{
// When querying the OS service for the range, it gives us the angles, which we don't need.