[network/neochat/release/26.08] src/app: Don't manage a whole new RoomListModel just for KRunner

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

Don't manage a whole new RoomListModel just for KRunner

This is a relatively expensive model (especially if you have a lot of
rooms) so much so it shows up in Hotspot. There's no reason not to
re-use the existing one though.

(cherry picked from commit 55ec567d17132c3af179e64c16da6041f3c918ba)

M  +3    -1    src/app/runner.cpp

https://invent.kde.org/network/neochat/-/commit/f9551c3834a5b010f67f98eb73f435b51cf36094

diff --git a/src/app/runner.cpp b/src/app/runner.cpp
index 8eee96f1b..f78350f0f 100644
--- a/src/app/runner.cpp
+++ b/src/app/runner.cpp
@@ -28,9 +28,11 @@ RemoteImage Runner::serializeImage(const QImage &image)
 
 Runner::Runner()
     : QObject()
-    , m_sourceModel(new RoomListModel(this))
+    , m_sourceModel(RoomManager::instance().roomListModel())
     , m_model(new SortFilterRoomListModel(m_sourceModel, this))
 {
+    Q_ASSERT(m_sourceModel != nullptr);
+
     connect(&Controller::instance(), &Controller::activeConnectionChanged, this, [this]() {
         m_sourceModel->setConnection(Controller::instance().activeConnection());
     });
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.