diff options
Diffstat (limited to 'src/plugins/sensors/blackberry/bborientationsensor.cpp')
-rw-r--r-- | src/plugins/sensors/blackberry/bborientationsensor.cpp | 16 |
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. |