diff options
author | p2niemel <pia.s.niemela@nokia.com> | 2011-06-17 10:09:20 +0300 |
---|---|---|
committer | p2niemel <pia.s.niemela@nokia.com> | 2011-06-17 10:09:20 +0300 |
commit | 78384c942e2dbfec38edc3b5709f29a5c9f131c6 (patch) | |
tree | e7d2efd5ec2557e7efbd92d3f20f945a8d5b0803 | |
parent | 79bce598a0da1d22ff7b64098c140182051d397a (diff) |
Fix to NB#255843
-rw-r--r-- | plugins/sensors/meego/meegoals.cpp | 12 | ||||
-rw-r--r-- | plugins/sensors/meego/meegoorientationsensor.cpp | 10 | ||||
-rw-r--r-- | plugins/sensors/meego/meegoproximitysensor.cpp | 12 |
3 files changed, 20 insertions, 14 deletions
diff --git a/plugins/sensors/meego/meegoals.cpp b/plugins/sensors/meego/meegoals.cpp index 65d008d749..9c6f5d68fe 100644 --- a/plugins/sensors/meego/meegoals.cpp +++ b/plugins/sensors/meego/meegoals.cpp @@ -56,10 +56,12 @@ meegoals::meegoals(QSensor *sensor) } void meegoals::start(){ - Unsigned data(((ALSSensorChannelInterface*)m_sensorInterface)->lux()); - m_reading.setLightLevel(getLightLevel(data.x())); - m_reading.setTimestamp(data.UnsignedData().timestamp_); - newReadingAvailable(); + if (m_sensorInterface) { + Unsigned data(((ALSSensorChannelInterface*)m_sensorInterface)->lux()); + m_reading.setLightLevel(getLightLevel(data.x())); + m_reading.setTimestamp(data.UnsignedData().timestamp_); + newReadingAvailable(); + } meegosensorbase::start(); } @@ -76,7 +78,7 @@ void meegoals::slotDataAvailable(const Unsigned& data) bool meegoals::doConnect(){ return QObject::connect(m_sensorInterface, SIGNAL(ALSChanged(const Unsigned&)), - this, SLOT(slotDataAvailable(const Unsigned&))); + this, SLOT(slotDataAvailable(const Unsigned&))); } diff --git a/plugins/sensors/meego/meegoorientationsensor.cpp b/plugins/sensors/meego/meegoorientationsensor.cpp index 9bc1d603c8..da3e814303 100644 --- a/plugins/sensors/meego/meegoorientationsensor.cpp +++ b/plugins/sensors/meego/meegoorientationsensor.cpp @@ -55,10 +55,12 @@ meegoorientationsensor::meegoorientationsensor(QSensor *sensor) void meegoorientationsensor::start(){ - Unsigned data(((OrientationSensorChannelInterface*)m_sensorInterface)->orientation()); - m_reading.setOrientation(meegoorientationsensor::getOrientation(data.x())); - m_reading.setTimestamp(data.UnsignedData().timestamp_); - newReadingAvailable(); + if (m_sensorInterface) { + Unsigned data(((OrientationSensorChannelInterface*)m_sensorInterface)->orientation()); + m_reading.setOrientation(meegoorientationsensor::getOrientation(data.x())); + m_reading.setTimestamp(data.UnsignedData().timestamp_); + newReadingAvailable(); + } meegosensorbase::start(); } diff --git a/plugins/sensors/meego/meegoproximitysensor.cpp b/plugins/sensors/meego/meegoproximitysensor.cpp index bd7cd864b9..63cab4db11 100644 --- a/plugins/sensors/meego/meegoproximitysensor.cpp +++ b/plugins/sensors/meego/meegoproximitysensor.cpp @@ -53,10 +53,12 @@ meegoproximitysensor::meegoproximitysensor(QSensor *sensor) } void meegoproximitysensor::start(){ - Unsigned data(((ProximitySensorChannelInterface*)m_sensorInterface)->proximity()); - m_reading.setClose(data.x()? true: false); - m_reading.setTimestamp(data.UnsignedData().timestamp_); - newReadingAvailable(); + if (m_sensorInterface) { + Unsigned data(((ProximitySensorChannelInterface*)m_sensorInterface)->proximity()); + m_reading.setClose(data.x()? true: false); + m_reading.setTimestamp(data.UnsignedData().timestamp_); + newReadingAvailable(); + } meegosensorbase::start(); } @@ -73,7 +75,7 @@ void meegoproximitysensor::slotDataAvailable(const Unsigned& data) bool meegoproximitysensor::doConnect(){ return (QObject::connect(m_sensorInterface, SIGNAL(dataAvailable(const Unsigned&)), - this, SLOT(slotDataAvailable(const Unsigned&)))); + this, SLOT(slotDataAvailable(const Unsigned&)))); } |