From 627f35f6a51bda27ad710e377a023c0cf07658a4 Mon Sep 17 00:00:00 2001 From: Sateallia Date: Tue, 30 May 2023 01:28:25 +0200 Subject: Remember last used filter fixes #1432 --- src/timeline/CommunitiesModel.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/timeline/CommunitiesModel.cpp') 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; } -- cgit 1.5.1