summary refs log tree commit diff
path: root/src/timeline/CommunitiesModel.cpp
diff options
context:
space:
mode:
authorSateallia <mail@satealliasdomain.net>2023-05-30 01:28:25 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-05-30 01:30:25 +0200
commit627f35f6a51bda27ad710e377a023c0cf07658a4 (patch)
tree68d9a95198e90f5d155cdb5c829ce408726e66b3 /src/timeline/CommunitiesModel.cpp
parentMake summary translation plural sensitive (diff)
downloadnheko-627f35f6a51bda27ad710e377a023c0cf07658a4.tar.xz
Remember last used filter
fixes #1432
Diffstat (limited to '')
-rw-r--r--src/timeline/CommunitiesModel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/timeline/CommunitiesModel.cpp b/src/timeline/CommunitiesModel.cpp
index a5f24c75..9a0d377c 100644
--- a/src/timeline/CommunitiesModel.cpp
+++ b/src/timeline/CommunitiesModel.cpp
@@ -383,6 +383,8 @@ CommunitiesModel::initializeSidebar()
     emit tagsChanged();
     emit hiddenTagsChanged();
     emit containsSubspacesChanged();
+    
+    setCurrentTagId(UserSettings::instance()->currentTagId());
 }
 
 void
@@ -585,6 +587,7 @@ CommunitiesModel::setCurrentTagId(const QString &tagId)
         for (const auto &t : qAsConst(tags_)) {
             if (t == tag) {
                 this->currentTagId_ = tagId;
+                UserSettings::instance()->setCurrentTagId(tagId);
                 emit currentTagIdChanged(currentTagId_);
                 return;
             }
@@ -594,17 +597,20 @@ CommunitiesModel::setCurrentTagId(const QString &tagId)
         for (const auto &t : spaceOrder_.tree) {
             if (t.id == tag) {
                 this->currentTagId_ = tagId;
+                UserSettings::instance()->setCurrentTagId(tagId);
                 emit currentTagIdChanged(currentTagId_);
                 return;
             }
         }
     } else if (tagId == QLatin1String("dm")) {
         this->currentTagId_ = tagId;
+        UserSettings::instance()->setCurrentTagId(tagId);
         emit currentTagIdChanged(currentTagId_);
         return;
     }
 
     this->currentTagId_ = QLatin1String("");
+    UserSettings::instance()->setCurrentTagId(tagId);
     emit currentTagIdChanged(currentTagId_);
 }
 
@@ -614,6 +620,7 @@ CommunitiesModel::trySwitchToSpace(const QString &tag)
     for (const auto &t : spaceOrder_.tree) {
         if (t.id == tag) {
             this->currentTagId_ = "space:" + tag;
+            UserSettings::instance()->setCurrentTagId(tag);
             emit currentTagIdChanged(currentTagId_);
             return true;
         }