[plasma/systemsettings] app: Fix loadModule not resetting subCategoryModel parent for modules w/o a submenu

Nate Graham <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit c26d1b64bd853e765f18b20454752b0e8d3f6274 by Nate Graham, on behalf of Mradul  Pal.
Committed on 17/08/2026 at 21:37.
Pushed by ngraham into branch 'master'.

Fix loadModule not resetting subCategoryModel parent for modules w/o a submenu

Loading a top-level module with no children via loadModule() (when
we use systemsettings kcm_user it calls loadModule()) left
subCategoryModel's parent index unchanged. Reopening the previously
active category then passed setParentIndex() the same index as
before, causing no model reset, no onCountChanged in SidebarMode.qml,
and the submenu page never being re-pushed onto pageStack.

Fix by clearing subCategoryModel's parent index when loading a
module with no children. The attached video shows before and after
scenes.

BUG: 524340
BUG: 514006
FIXED-IN: 6.6.7

M  +1    -0    app/SidebarMode.cpp

https://invent.kde.org/plasma/systemsettings/-/commit/c26d1b64bd853e765f18b20454752b0e8d3f6274

diff --git a/app/SidebarMode.cpp b/app/SidebarMode.cpp
index de5b003a..d1e87288 100644
--- a/app/SidebarMode.cpp
+++ b/app/SidebarMode.cpp
@@ -402,6 +402,7 @@ void SidebarMode::loadModule(const QModelIndex &activeModule, const QStringList
                         d->subCategoryModel->setParentIndex(idx);
                         d->activeSubCategoryRow = 0;
                     } else {
+                        d->subCategoryModel->setParentIndex(QModelIndex());
                         d->activeSubCategoryRow = -1;
                     }
                 }
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.