summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.si>2021-09-16 21:54:22 +0200
committerTimotej Lazar <timotej.lazar@araneo.si>2021-09-16 21:54:22 +0200
commitab472b748df4f1e96617c2e2531cc372b24f88f9 (patch)
tree93fe8d9d2a93aee2c43bf0b6aa8f81b538660ff5
parentca524131a5ae0cc61f8a307f6e4ba130d498a457 (diff)
Reduce C++ fancyness
GCC 5.5 don’t like it. Revert once MXE catches up. Or not.
-rw-r--r--event_filter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/event_filter.cpp b/event_filter.cpp
index d3f5e17..68aa702 100644
--- a/event_filter.cpp
+++ b/event_filter.cpp
@@ -9,7 +9,8 @@ void EventFilter::setFilter(const QString& text)
filters.clear();
if (!text.isEmpty()) {
for (const auto &s : text.split(QRegularExpression{"\\s+"})) {
- if (const int split = s.indexOf(":"); split == -1)
+ const int split = s.indexOf(":");
+ if (split == -1)
filters.append({"", s.trimmed()});
else
filters.append({s.left(split).trimmed(), s.mid(split+1).trimmed()});
@@ -27,7 +28,8 @@ bool EventFilter::remove(int row)
static bool matches(const QVariantMap& values, const QString& name, const QString& value)
{
for (auto kv = values.constKeyValueBegin(); kv != values.constKeyValueEnd(); kv++) {
- const auto& [fieldName, fieldValue] = *kv;
+ const auto& fieldName = kv->first;
+ const auto& fieldValue = kv->second;
if (!name.isEmpty() && !fieldName.startsWith(name))
continue;