Commit f2ef6848 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Always reset minimum and maximum, not only when inserting

Otherwise we do not get a correct minumum/maximum value when those get
updated later on.


(cherry picked from commit f0299ad5)
parent 356c39a7
......@@ -388,6 +388,9 @@ void SensorDataModel::onMetaDataChanged(const QString &sensorId, const SensorInf
qCDebug(LIBKSYSGUARD_SENSORS) << "Received metadata change for" << sensorId;
d->minimum.reset();
d->maximum.reset();
// Simple case: Just an update for a sensor's metadata
if (d->sensorInfos.contains(sensorId)) {
d->sensorInfos[sensorId] = info;
......@@ -402,9 +405,6 @@ void SensorDataModel::onMetaDataChanged(const QString &sensorId, const SensorInf
d->sensorData[sensorId] = QVariant{};
endInsertColumns();
d->minimum.reset();
d->maximum.reset();
SensorDaemonInterface::instance()->requestValue(sensorId);
emit sensorMetaDataChanged();
Q_EMIT readyChanged();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment