Commit 6f3e6031 authored by David Redondo's avatar David Redondo 🏎
Browse files

Also check if the path and id are the same

The sensorId can contain characters which have special meaning in regexes. We
cannot escape them however because we also pass sensor regexes through the same
path. So simply compare for equality before doing any matching.
parent 525d110b
...@@ -129,7 +129,7 @@ void KSysGuard::SensorQuery::Private::updateResult(const QDBusPendingReply<Senso ...@@ -129,7 +129,7 @@ void KSysGuard::SensorQuery::Private::updateResult(const QDBusPendingReply<Senso
const auto sensorIds = reply.value().keys(); const auto sensorIds = reply.value().keys();
for (auto id : sensorIds) { for (auto id : sensorIds) {
if (regexp.match(id).hasMatch()) { if (id == path || regexp.match(id).hasMatch()) {
result.append(qMakePair(id, reply.value().value(id))); result.append(qMakePair(id, reply.value().value(id)));
} }
} }
......
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