summary refs log tree commit diff
path: root/src/RoomInfoListItem.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-10-17 00:57:29 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-10-17 00:57:29 +0200
commitbd0deb721322ed23551bf9d9d291637a147cc987 (patch)
treedfe6483d52c50c2d2ad7aa50f0cf17d0e1a1f459 /src/RoomInfoListItem.cpp
parentAnswer key requests for all our sessions (diff)
downloadnheko-bd0deb721322ed23551bf9d9d291637a147cc987.tar.xz
Fix crash on exit
Diffstat (limited to 'src/RoomInfoListItem.cpp')
-rw-r--r--src/RoomInfoListItem.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/RoomInfoListItem.cpp b/src/RoomInfoListItem.cpp
index f234b59b..985ab1b9 100644
--- a/src/RoomInfoListItem.cpp
+++ b/src/RoomInfoListItem.cpp
@@ -203,10 +203,7 @@ RoomInfoListItem::init(QWidget *parent)
         });
 }
 
-RoomInfoListItem::RoomInfoListItem(QString room_id,
-                                   const RoomInfo &info,
-                                   QSharedPointer<UserSettings> userSettings,
-                                   QWidget *parent)
+RoomInfoListItem::RoomInfoListItem(QString room_id, const RoomInfo &info, QWidget *parent)
   : QWidget(parent)
   , roomType_{info.is_invite ? RoomType::Invited : RoomType::Joined}
   , roomId_(std::move(room_id))
@@ -214,7 +211,6 @@ RoomInfoListItem::RoomInfoListItem(QString room_id,
   , isPressed_(false)
   , unreadMsgCount_(0)
   , unreadHighlightedMsgCount_(0)
-  , settings(userSettings)
 {
         init(parent);
 }
@@ -451,7 +447,7 @@ RoomInfoListItem::calculateImportance() const
         // returns ImportanceDisabled or Invite
         if (isInvite()) {
                 return Invite;
-        } else if (!settings->sortByImportance()) {
+        } else if (!ChatPage::instance()->userSettings()->sortByImportance()) {
                 return ImportanceDisabled;
         } else if (unreadHighlightedMsgCount_) {
                 return NewMentions;