Commit 2d03f3ac authored by David Redondo's avatar David Redondo 🏎

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
parent 8fcc3896
......@@ -258,6 +258,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