Home
Phabricator
Search
Log In
Paste
P471
Addendum to D23274
Active
Public
Actions
Authored by
ngraham
on Sep 24 2019, 4:41 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
diff --git a/sidebar/SidebarMode.cpp b/sidebar/SidebarMode.cpp
index 3340d6f..8770189 100644
--- a/sidebar/SidebarMode.cpp
+++ b/sidebar/SidebarMode.cpp
@@ -426,6 +426,10 @@ void SidebarMode::changeModule( const QModelIndex& activeModule )
{
d->moduleView->closeModules();
+ if (!activeModule.isValid()) {
+ return;
+ }
+
const int subRows = d->searchModel->rowCount(activeModule);
if ( subRows < 2) {
d->moduleView->loadModule( activeModule );
@@ -449,13 +453,15 @@ int SidebarMode::activeCategory() const
void SidebarMode::setActiveCategory(int cat)
{
+ const QModelIndex idx = d->searchModel->index(cat, 0);
+ int newCategoryRow;
if (cat != -1) {
setIntroPageVisible(false);
+ newCategoryRow = d->searchModel->mapToSource(idx).row();
+ } else {
+ newCategoryRow = cat;
}
- const QModelIndex idx = d->searchModel->index(cat, 0);
- const int newCategoryRow = d->searchModel->mapToSource(idx).row();
-
if (d->activeCategory == newCategoryRow) {
return;
}
ngraham
created this paste.
Sep 24 2019, 4:41 PM
ngraham
created this object in space
S1 KDE Community
.
ngraham
mentioned this in
D23274: Add "Show intro page" button to System Settings sidebar
.
Log In to Comment