diff options
author | Lincoln Ramsay <lincoln.ramsay@nokia.com> | 2011-12-19 16:43:45 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-12-19 08:39:17 +0100 |
commit | 72a3d3b60b20abbc7e6af2ec1e33275bfa7841b1 (patch) | |
tree | aaae01c57140418e8221dc2baa1a4d8798eba59f /src/plugins/sensors/simulator | |
parent | c6248d18c0acab953021fc136e92e842c91abb78 (diff) |
compile with strict warnings
Even though the code was converting between one enum and the other, it was
continuing to use the old enum value, causing a warning.
Map default: to Undefined so this always works (and never uses an
uninitialized variable).
Change-Id: Ic7da7efebccfb2733498251f67d4d25a56637f44
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com>
Diffstat (limited to 'src/plugins/sensors/simulator')
-rw-r--r-- | src/plugins/sensors/simulator/simulatorambientlightsensor.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/sensors/simulator/simulatorambientlightsensor.cpp b/src/plugins/sensors/simulator/simulatorambientlightsensor.cpp index 040bc2de..0d4a4a4d 100644 --- a/src/plugins/sensors/simulator/simulatorambientlightsensor.cpp +++ b/src/plugins/sensors/simulator/simulatorambientlightsensor.cpp @@ -56,9 +56,6 @@ void SimulatorAmbientLightSensor::poll() QtMobility::QAmbientLightReadingData data = get_qtAmbientLightData(); QAmbientLightReading::LightLevel convertedLightLevel; switch (data.lightLevel) { - case QtMobility::Undefined: - convertedLightLevel = QAmbientLightReading::Undefined; - break; case QtMobility::Dark: convertedLightLevel = QAmbientLightReading::Dark; break; @@ -74,6 +71,9 @@ void SimulatorAmbientLightSensor::poll() case QtMobility::Sunny: convertedLightLevel = QAmbientLightReading::Sunny; break; + default: + convertedLightLevel = QAmbientLightReading::Undefined; + break; } quint64 newTimestamp; @@ -82,9 +82,9 @@ void SimulatorAmbientLightSensor::poll() else newTimestamp = data.timestamp.toTime_t(); if (m_reading.timestamp() != newTimestamp - || m_reading.lightLevel() != data.lightLevel) { + || m_reading.lightLevel() != convertedLightLevel) { m_reading.setTimestamp(newTimestamp); - m_reading.setLightLevel(data.lightLevel); + m_reading.setLightLevel(convertedLightLevel); newReadingAvailable(); } |