[plasma/systemsettings/Plasma/6.6] 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 9e64479cdf458f57ab0048b603d358847b8932eb by Nate Graham.
Committed on 17/08/2026 at 21:38.
Pushed by ngraham into branch 'Plasma/6.6'.

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


(cherry picked from commit c26d1b64bd853e765f18b20454752b0e8d3f6274)

55a00b89 Fix: SidebarMode::loadModule not resetting subCategoryModel parent for modules without a submenu

Co-authored-by: Mradul  Pal <[email protected]>

M  +1    -0    app/SidebarMode.cpp

https://invent.kde.org/plasma/systemsettings/-/commit/9e64479cdf458f57ab0048b603d358847b8932eb

diff --git a/app/SidebarMode.cpp b/app/SidebarMode.cpp
index 6d4ef2be..f901dded 100644
--- a/app/SidebarMode.cpp
+++ b/app/SidebarMode.cpp
@@ -403,6 +403,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.