[network/neochat/release/26.08] src/rooms/models: Only invalidate filtering when IsChildSpaceRole changes

Joshua Goins <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 943594b63c20280db03baac7ef455a8457485ae7 by Joshua Goins, on behalf of Tobias Fella.
Committed on 24/07/2026 at 20:14.
Pushed by redstrate into branch 'release/26.08'.

Only invalidate filtering when IsChildSpaceRole changes

This should be more efficient and seems to fix a weird flickering in the room list

(cherry picked from commit cb0cac3a992fce60b83d077ddddb8dcccb160cad)

M  +2    -1    src/rooms/models/sortfilterspacelistmodel.cpp

https://invent.kde.org/network/neochat/-/commit/943594b63c20280db03baac7ef455a8457485ae7

diff --git a/src/rooms/models/sortfilterspacelistmodel.cpp b/src/rooms/models/sortfilterspacelistmodel.cpp
index e4efc3255..04fa430e4 100644
--- a/src/rooms/models/sortfilterspacelistmodel.cpp
+++ b/src/rooms/models/sortfilterspacelistmodel.cpp
@@ -13,7 +13,8 @@ SortFilterSpaceListModel::SortFilterSpaceListModel(RoomListModel *sourceModel, Q
 
     connect(this->sourceModel(), &QAbstractListModel::dataChanged, this, [this](const QModelIndex &, const QModelIndex &, QList<int> roles) {
         if (roles.contains(RoomListModel::IsChildSpaceRole)) {
-            invalidate();
+            beginFilterChange();
+            endFilterChange();
         }
         Q_EMIT countChanged();
     });
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.