diff options
author | Lorn Potter <lorn.potter@jollamobile.com> | 2013-10-12 17:19:44 +1000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-10-23 06:12:42 +0200 |
commit | 8aabcf1eb258aedc9c268d6c1de191747f4f4400 (patch) | |
tree | f7a2a8a23f400fc8c8eae4a533b07067923f0e28 /src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp | |
parent | e4ff58731699e1202396f9ef5863f462fa1d9456 (diff) |
make sensorfw plugin handle the sensord restarting.
This way, clients that are connected will continue to receive updates
after the sensord has restarted, without the need to restart the
sensor.
Task-number: QTBUG-34050
Change-Id: I4a8fbca189764cf23a1453feae5c1fd9ed6911e7
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp')
-rw-r--r-- | src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp b/src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp index 1f4c2b54..eaf7232b 100644 --- a/src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp +++ b/src/plugins/sensors/sensorfw/sensorfwproximitysensor.cpp @@ -42,12 +42,14 @@ #include "sensorfwproximitysensor.h" char const * const SensorfwProximitySensor::id("sensorfw.proximitysensor"); -bool SensorfwProximitySensor::m_initDone = false; +//bool SensorfwProximitySensor::m_initDone = false; SensorfwProximitySensor::SensorfwProximitySensor(QSensor *sensor) - : SensorfwSensorBase(sensor), m_exClose(false) + : SensorfwSensorBase(sensor), + m_exClose(false) + , m_initDone(false) { - initSensor<ProximitySensorChannelInterface>(m_initDone); + init(); setReading<QProximityReading>(&m_reading); addDataRate(10,10); //TODO: fix this when we know better sensor->setDataRate(10);//set a default rate @@ -86,3 +88,9 @@ QString SensorfwProximitySensor::sensorName() const { return "proximitysensor"; } + +void SensorfwProximitySensor::init() +{ + m_initDone = false; + initSensor<ProximitySensorChannelInterface>(m_initDone); +} |