Commit 8e28113e authored by Fabian Vogt's avatar Fabian Vogt
Browse files

[Icon View] Don't open modules twice on clicking

changeModule is called on activated and clicked now.
parent 98cf5ba4
...@@ -149,11 +149,17 @@ void IconMode::searchChanged(const QString &text) ...@@ -149,11 +149,17 @@ void IconMode::searchChanged(const QString &text)
void IconMode::changeModule(const QModelIndex &activeModule) void IconMode::changeModule(const QModelIndex &activeModule)
{ {
// Already loaded?
MenuItem *item = activeModule.data(Qt::UserRole).value<MenuItem *>();
if(d->moduleView->activeModule() == &item->item())
return;
changeModuleWithArgs(activeModule, QStringList()); changeModuleWithArgs(activeModule, QStringList());
} }
void IconMode::changeModuleWithArgs(const QModelIndex &activeModule, const QStringList &args) void IconMode::changeModuleWithArgs(const QModelIndex &activeModule, const QStringList &args)
{ {
// Always reopen because args might have changed
d->moduleView->closeModules(); d->moduleView->closeModules();
d->mainWidget->setCurrentWidget(d->moduleView); d->mainWidget->setCurrentWidget(d->moduleView);
......
Supports Markdown
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