summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2015-04-01 08:42:30 +0200
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-04-01 08:43:02 +0200
commitc333d25a2a89aeefa936810945fe965cf1086797 (patch)
tree92ed5df4adb8e4fc105f8a20f74a485686165aa3 /src/plugins
parent67bc52239aba6daa7f9b7659cc05074635fde7e2 (diff)
parent767f33d8c657f194d6d2e33f87ff9fc4560b30fe (diff)
downloadqtsensors-c333d25a2a89aeefa936810945fe965cf1086797.tar.gz
Merge remote-tracking branch 'gerrit/5.4' into 5.5
Change-Id: If6f44fe2cd69bae92cddd4682e952f2528b85184
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/sensors/sensorfw/sensorfwsensorbase.cpp27
-rw-r--r--src/plugins/sensors/sensorfw/sensorfwsensorbase.h2
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