From abac4c8d34db971382c4716dea735f1fd0755fa3 Mon Sep 17 00:00:00 2001 From: Emi Simpson Date: Sun, 15 Mar 2020 14:30:21 -0400 Subject: [PATCH] Sort room list on setting change --- src/RoomList.cpp | 4 ++++ src/UserSettingsPage.h | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/RoomList.cpp b/src/RoomList.cpp index a9ce957..13a4fa6 100644 --- a/src/RoomList.cpp +++ b/src/RoomList.cpp @@ -65,6 +65,10 @@ RoomList::RoomList(QSharedPointer userSettings, QWidget *parent) topLayout_->addWidget(scrollArea_); connect(this, &RoomList::updateRoomAvatarCb, this, &RoomList::updateRoomAvatar); + connect(userSettings.get(), + &UserSettings::roomSortingChanged, + this, + &RoomList::sortRoomsByLastMessage); } void diff --git a/src/UserSettingsPage.h b/src/UserSettingsPage.h index a1bc4ff..d47ceb8 100644 --- a/src/UserSettingsPage.h +++ b/src/UserSettingsPage.h @@ -87,7 +87,11 @@ public: save(); } - void setIgnoreMinorEvents(bool state) { ignoreMinorEvents_ = state; } + void setIgnoreMinorEvents(bool state) + { + ignoreMinorEvents_ = state; + emit roomSortingChanged(); + } void setButtonsInTimeline(bool state) { @@ -124,6 +128,7 @@ public: signals: void groupViewStateChanged(bool state); + void roomSortingChanged(); private: // Default to system theme if QT_QPA_PLATFORMTHEME var is set.