From f6fa494666b0cee5cb33706d9a33b5f9d20b206c Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 24 Jun 2020 14:50:11 +0200 Subject: Make connections across threads queued in any case --- src/ChatPage.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'src/ChatPage.cpp') diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index 3b8af33a..0b290927 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -545,8 +545,12 @@ ChatPage::ChatPage(QSharedPointer userSettings, QWidget *parent) emit notificationsRetrieved(std::move(res)); }); }); - connect(this, &ChatPage::syncRoomlist, room_list_, &RoomList::sync); - connect(this, &ChatPage::syncTags, communitiesList_, &CommunitiesList::syncTags); + connect(this, &ChatPage::syncRoomlist, room_list_, &RoomList::sync, Qt::QueuedConnection); + connect(this, + &ChatPage::syncTags, + communitiesList_, + &CommunitiesList::syncTags, + Qt::QueuedConnection); connect( this, &ChatPage::syncTopBar, this, [this](const std::map &updates) { if (updates.find(currentRoom()) != updates.end()) @@ -561,11 +565,15 @@ ChatPage::ChatPage(QSharedPointer userSettings, QWidget *parent) user_info_widget_->setDisplayName(name); }); - connect(this, &ChatPage::tryInitialSyncCb, this, &ChatPage::tryInitialSync); - connect(this, &ChatPage::trySyncCb, this, &ChatPage::trySync); - connect(this, &ChatPage::tryDelayedSyncCb, this, [this]() { - QTimer::singleShot(RETRY_TIMEOUT, this, &ChatPage::trySync); - }); + connect( + this, &ChatPage::tryInitialSyncCb, this, &ChatPage::tryInitialSync, Qt::QueuedConnection); + connect(this, &ChatPage::trySyncCb, this, &ChatPage::trySync, Qt::QueuedConnection); + connect( + this, + &ChatPage::tryDelayedSyncCb, + this, + [this]() { QTimer::singleShot(RETRY_TIMEOUT, this, &ChatPage::trySync); }, + Qt::QueuedConnection); connect(this, &ChatPage::dropToLoginPageCb, this, &ChatPage::dropToLoginPage); -- cgit 1.5.1