Merge lp:~brendan-donegan/qtubuntu-sensors/bug1337284 into lp:qtubuntu-sensors

Proposed by Brendan Donegan
Status: Merged
Approved by: Ricardo Mendoza
Approved revision: 70
Merged at revision: 70
Proposed branch: lp:~brendan-donegan/qtubuntu-sensors/bug1337284
Merge into: lp:qtubuntu-sensors
Diff against target: 12 lines (+1/-1)
1 file modified
plugins/sensors/core_orientation_sensor.cpp (+1/-1)
To merge this branch: bzr merge lp:~brendan-donegan/qtubuntu-sensors/bug1337284
Reviewer Review Type Date Requested Status
Ricardo Mendoza (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+225840@code.launchpad.net

Commit message

Initialize m_last{X,Y,Z} to avoid faulty values

Description of the change

The values of m_lastX, m_lastY and m_lastZ were not being initialized on creation. This allowed some faulty values to get through and corrupt the logic of the function, meaning that sometimes a rotation event could be issued for no reason. This branch fixes that, and I've tested that in the scenario where the unexpected rotation would occur, it no longer does.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Olivier Tilloy (osomon) wrote :

So, the issue really was random after all, not tied to the use of the "-testability" flag, nor to the page that was being browsed?

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

It's likely to be timing related, which the use of -testability and the exact content of the page to be loaded would obviously contribute to.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ricardo Mendoza (ricmm) wrote :

Well I believe testability is doing something to var initialization. The uninitialized vars were taking different values when using it against not using it. This might be a bit of a concern, as it means that it can introduce different behaviour where unexpected values might come in.

Other than that, this branch works fine. Approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/sensors/core_orientation_sensor.cpp'
2--- plugins/sensors/core_orientation_sensor.cpp 2014-06-18 14:44:26 +0000
3+++ plugins/sensors/core_orientation_sensor.cpp 2014-07-07 14:39:22 +0000
4@@ -42,7 +42,7 @@
5 };
6
7 core::OrientationSensor::OrientationSensor(QSensor *sensor)
8- : QSensorBackend(sensor)
9+ : QSensorBackend(sensor), m_lastX(0), m_lastY(0), m_lastZ(0)
10 {
11 // Register the reading instance with the parent
12 setReading<QOrientationReading>(&m_reading);

Subscribers

People subscribed via source and target branches