Commit d923aeec authored by David Edmundson's avatar David Edmundson Committed by Nate Graham
Browse files

[Sidebar] Avoid reloading already loaded module

BUG: 420196


(cherry picked from commit 9daf327a)
parent 4f28476d
......@@ -436,18 +436,23 @@ void SidebarMode::loadModule( const QModelIndex& activeModule, const QStringList
return;
}
if( !d->moduleView->resolveChanges() ) {
MenuItem *mi = activeModule.data(MenuModel::MenuItemRole).value<MenuItem *>();
if (!mi) {
return;
}
d->moduleView->closeModules();
MenuItem *mi = activeModule.data(MenuModel::MenuItemRole).value<MenuItem *>();
// If we are trying to load a module already open
if (d->moduleView->activeModule() && mi->item() == *d->moduleView->activeModule()) {
return;
}
if (!mi) {
if( !d->moduleView->resolveChanges() ) {
return;
}
d->moduleView->closeModules();
if (homeItem()) {
d->m_introPageVisible = activeModule == d->categorizedModel->mapFromSource(d->model->indexForItem(homeItem()));
emit introPageVisibleChanged();
......
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