summary refs log tree commit diff
path: root/src/PowerlevelsEditModels.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-09-28 17:47:41 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-09-28 17:47:41 +0200
commitbffa0115d449e87d2f962059686004caa9ad4430 (patch)
tree8bab0e7fb2fd9244f65262cf227485992290cec0 /src/PowerlevelsEditModels.cpp
parentMerge branch 'v0.10.2-fixes' (diff)
downloadnheko-bffa0115d449e87d2f962059686004caa9ad4430.tar.xz
Make clazy happy
Diffstat (limited to 'src/PowerlevelsEditModels.cpp')
-rw-r--r--src/PowerlevelsEditModels.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/PowerlevelsEditModels.cpp b/src/PowerlevelsEditModels.cpp
index 09e5b05d..c7ca24f5 100644
--- a/src/PowerlevelsEditModels.cpp
+++ b/src/PowerlevelsEditModels.cpp
@@ -692,10 +692,10 @@ PowerlevelsSpacesListModel::PowerlevelsSpacesListModel(const std::string &room_i
               cache::client()->getStateEvent<mtx::events::state::space::Parent>(s, space);
             if (parent && parent->content.via && !parent->content.via->empty() &&
                 parent->content.canonical) {
-                auto parent = cache::client()->getStateEvent<mtx::events::state::PowerLevels>(s);
+                auto parentPl = cache::client()->getStateEvent<mtx::events::state::PowerLevels>(s);
 
-                spaces.push_back(
-                  Entry{s, parent ? parent->content : mtx::events::state::PowerLevels{}, false});
+                spaces.push_back(Entry{
+                  s, parentPl ? parentPl->content : mtx::events::state::PowerLevels{}, false});
                 addChildren(s);
             }
         }
@@ -726,6 +726,7 @@ struct PowerLevelApplier
               if (e) {
                   if (e->status_code == 429 && e->matrix_error.retry_after.count() != 0) {
                       QTimer::singleShot(e->matrix_error.retry_after,
+                                         ChatPage::instance(),
                                          [self = std::move(self)]() mutable { self.next(); });
                       return;
                   }
@@ -746,7 +747,7 @@ PowerlevelsSpacesListModel::commit()
 {
     std::vector<std::string> spacesToApplyTo;
 
-    for (const auto &s : spaces)
+    for (const auto &s : qAsConst(spaces))
         if (s.apply)
             spacesToApplyTo.push_back(s.roomid);