Commit 9dc314d8 authored by David Redondo's avatar David Redondo 🏎
Browse files

Remove sensors before adding

Otherwise we remove valid sensors if they have no parent or if the
SensorObject is not parented to the container.
BUG:438354
FIXED-IN:5.22.1


(cherry picked from commit 1b427d1b)
parent e11afdae
......@@ -212,14 +212,6 @@ void AggregateSensor::updateSensors()
if (!d->matchObjects.isValid()) {
return;
}
for (auto obj : d->subsystem->objects()) {
if (d->matchObjects.match(obj->id()).hasMatch()) {
auto sensor = obj->sensor(d->matchProperty);
if (sensor) {
addSensor(sensor);
}
}
}
auto itr = d->sensors.begin();
while (itr != d->sensors.end()) {
......@@ -237,6 +229,16 @@ void AggregateSensor::updateSensors()
}
}
for (auto obj : d->subsystem->objects()) {
if (d->matchObjects.match(obj->id()).hasMatch()) {
auto sensor = obj->sensor(d->matchProperty);
if (sensor) {
addSensor(sensor);
}
}
}
delayedEmitDataChanged();
}
......
Markdown is supported
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