Commit 3489e39c authored by David Redondo's avatar David Redondo 🏎 Committed by Nate Graham

Also load category when opening startup module in icon mode

We should open it in a state like when the user navigated to it. For that
loadModule will now change the page if the requested module is already
loaded.
BUG: 429306


(cherry picked from commit 2d03f3ac)
parent 851d5a48
......@@ -175,6 +175,11 @@ void ModuleView::addModule( KCModuleInfo *module, const QStringList &args )
return;
}
if (KPageWidgetItem *page = d->mModules.key(module)) {
activeModuleChanged(page, d->mPageWidget->currentPage());
return;
}
// Create the scroller
QScrollArea * moduleScroll = new QScrollArea( this );
// Prepare the scroll area
......
......@@ -146,14 +146,19 @@ void IconMode::changeModuleWithArgs( const QModelIndex& activeModule, const QStr
d->moduleView->closeModules();
d->mainWidget->setCurrentWidget( d->moduleView );
const bool openCategoryFirst = activeModule.parent().isValid();
// avoid double titles by setting the right face type before loading the module
if ( d->categoryView->model()->rowCount(activeModule) > 1 ) {
if (openCategoryFirst || d->categoryView->model()->rowCount(activeModule) > 1 ) {
d->moduleView->setFaceType(KPageView::List);
} else {
d->moduleView->setFaceType(KPageView::Plain);
}
d->moduleView->loadModule( activeModule, args );
if (openCategoryFirst) {
d->moduleView->loadModule(activeModule.parent(), {});
}
d->moduleView->loadModule(activeModule, args);
}
void IconMode::moduleLoaded()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment