summaryrefslogtreecommitdiffstats
path: root/src/sensors/qsensor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sensors/qsensor.cpp')
-rw-r--r--src/sensors/qsensor.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/sensors/qsensor.cpp b/src/sensors/qsensor.cpp
index 9d41dbf7..56c11bc4 100644
--- a/src/sensors/qsensor.cpp
+++ b/src/sensors/qsensor.cpp
@@ -480,20 +480,9 @@ int QSensor::dataRate() const
void QSensor::setDataRate(int rate)
{
Q_D(QSensor);
- if (rate == 0 || !isConnectedToBackend()) {
+ if (d->dataRate != rate) {
d->dataRate = rate;
- return;
- }
- bool warn = true;
- Q_FOREACH (const qrange &range, d->availableDataRates) {
- if (rate >= range.first && rate <= range.second) {
- warn = false;
- d->dataRate = rate;
- break;
- }
- }
- if (warn) {
- qWarning() << "setDataRate:" << rate << "is not supported by the sensor.";
+ emit dataRateChanged();
}
}