Changeset View
Changeset View
Standalone View
Standalone View
sensors/SensorQuery.cpp
Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Line(s) | |||||
119 | { | 119 | { | ||
120 | if (path.isEmpty()) { // add everything | 120 | if (path.isEmpty()) { // add everything | ||
121 | const SensorInfoMap response = reply.value(); | 121 | const SensorInfoMap response = reply.value(); | ||
122 | for (auto it = response.constBegin(); it != response.constEnd(); it++) { | 122 | for (auto it = response.constBegin(); it != response.constEnd(); it++) { | ||
123 | result.append(qMakePair(it.key(), it.value())); | 123 | result.append(qMakePair(it.key(), it.value())); | ||
124 | } | 124 | } | ||
125 | return; | 125 | return; | ||
126 | } | 126 | } | ||
127 | auto regexp = QRegularExpression{QRegularExpression::wildcardToRegularExpression(path)}; | 127 | auto regexp = QRegularExpression{path}; | ||
128 | 128 | | |||
129 | const auto sensorIds = reply.value().keys(); | 129 | const auto sensorIds = reply.value().keys(); | ||
130 | for (auto id : sensorIds) { | 130 | for (auto id : sensorIds) { | ||
131 | if (regexp.match(id).hasMatch()) { | 131 | if (regexp.match(id).hasMatch()) { | ||
132 | result.append(qMakePair(id, reply.value().value(id))); | 132 | result.append(qMakePair(id, reply.value().value(id))); | ||
133 | } | 133 | } | ||
134 | } | 134 | } | ||
135 | } | 135 | } |