summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-02-07 02:52:18 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2020-02-07 02:56:03 +0100
commitc5af3543e64c03eb22912b6317f4bbad4dbe14f5 (patch)
tree79b38b9396955cf04f59226fd6519540bb17e8b3 /src
parentDon't leak the full file path when sending file (diff)
downloadnheko-c5af3543e64c03eb22912b6317f4bbad4dbe14f5.tar.xz
fix c++11 range-loop might detach Qt container
Diffstat (limited to 'src')
-rw-r--r--src/popups/UserMentions.cpp2
-rw-r--r--src/timeline/DelegateChooser.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/popups/UserMentions.cpp b/src/popups/UserMentions.cpp
index b0223f7f..2e70dbd3 100644
--- a/src/popups/UserMentions.cpp
+++ b/src/popups/UserMentions.cpp
@@ -74,7 +74,7 @@ UserMentions::initializeMentions(const QMap<QString, mtx::responses::Notificatio
         nhlog::ui()->debug("Initializing " + std::to_string(notifs.size()) + " notifications.");
 
         for (const auto &item : notifs) {
-                for (const auto notif : item.notifications) {
+                for (const auto &notif : item.notifications) {
                         const auto event_id = QString::fromStdString(utils::event_id(notif.event));
 
                         try {
diff --git a/src/timeline/DelegateChooser.cpp b/src/timeline/DelegateChooser.cpp
index 632a2a64..46ab6c0e 100644
--- a/src/timeline/DelegateChooser.cpp
+++ b/src/timeline/DelegateChooser.cpp
@@ -91,7 +91,7 @@ DelegateChooser::clearChoices(QQmlListProperty<DelegateChoice> *p)
 void
 DelegateChooser::recalcChild()
 {
-        for (const auto choice : choices_) {
+        for (const auto choice : qAsConst(choices_)) {
                 auto choiceValue = choice->roleValue();
                 if (!roleValue_.isValid() || !choiceValue.isValid() || choiceValue == roleValue_) {
                         if (child) {