diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-04-01 08:42:30 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-04-01 08:43:02 +0200 |
commit | c333d25a2a89aeefa936810945fe965cf1086797 (patch) | |
tree | 92ed5df4adb8e4fc105f8a20f74a485686165aa3 /src | |
parent | 67bc52239aba6daa7f9b7659cc05074635fde7e2 (diff) | |
parent | 767f33d8c657f194d6d2e33f87ff9fc4560b30fe (diff) | |
download | qtsensors-c333d25a2a89aeefa936810945fe965cf1086797.tar.gz |
Merge remote-tracking branch 'gerrit/5.4' into 5.5
Change-Id: If6f44fe2cd69bae92cddd4682e952f2528b85184
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/sensors/sensorfw/sensorfwsensorbase.cpp | 27 | ||||
-rw-r--r-- | src/plugins/sensors/sensorfw/sensorfwsensorbase.h | 2 |
2 files changed, 29 insertions, 0 deletions
diff --git a/src/plugins/sensors/sensorfw/sensorfwsensorbase.cpp b/src/plugins/sensors/sensorfw/sensorfwsensorbase.cpp index b85dbb0..82302ac 100644 --- a/src/plugins/sensors/sensorfw/sensorfwsensorbase.cpp +++ b/src/plugins/sensors/sensorfw/sensorfwsensorbase.cpp @@ -65,6 +65,7 @@ SensorfwSensorBase::SensorfwSensorBase(QSensor *sensor) connect(watcher, SIGNAL(serviceUnregistered(QString)), this, SLOT(sensordUnregistered())); + connect(sensor, SIGNAL(alwaysOnChanged()),this,SLOT(standyOverrideChanged())); m_available = QDBusConnection::systemBus().interface()->isServiceRegistered("com.nokia.SensorService"); if (m_available) @@ -290,3 +291,29 @@ bool SensorfwSensorBase::initSensorInterface(QString const &name) setRanges(); return true; } + +void SensorfwSensorBase::standyOverrideChanged() +{ + m_sensorInterface->setStandbyOverride(sensor()->isAlwaysOn()); +} + +bool SensorfwSensorBase::isFeatureSupported(QSensor::Feature feature) const +{ + switch (feature) { + case QSensor::AlwaysOn: + return true; + case QSensor::AxesOrientation: + case QSensor::Buffering: + case QSensor::AccelerationMode: + case QSensor::SkipDuplicates: + case QSensor::PressureSensorTemperature: + case QSensor::GeoValues: + case QSensor::Reserved: + case QSensor::FieldOfView: + return false; + break; + }; + + return false; +} + diff --git a/src/plugins/sensors/sensorfw/sensorfwsensorbase.h b/src/plugins/sensors/sensorfw/sensorfwsensorbase.h index 48f44ec..385c550 100644 --- a/src/plugins/sensors/sensorfw/sensorfwsensorbase.h +++ b/src/plugins/sensors/sensorfw/sensorfwsensorbase.h @@ -95,6 +95,7 @@ protected: int bufferSize() const; virtual qreal correctionFactor() const; bool reinitIsNeeded; + bool isFeatureSupported(QSensor::Feature feature) const; private: bool initSensorInterface(QString const &); @@ -109,6 +110,7 @@ private: private slots: void connectToSensord(); void sensordUnregistered(); + void standyOverrideChanged(); }; #endif |