Skip to content
Snippets Groups Projects
Commit c5af3543 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

fix c++11 range-loop might detach Qt container

parent d113733c
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment