- Removes an action from the Operations root menu before adding it to a submenu.
This way, it is not "already tracked" and unity does not discard it.
This commit is contained in:
Maxime Gimeno 2016-09-08 14:47:04 +02:00
parent bbf00dbe52
commit 3f40a60395
1 changed files with 3 additions and 1 deletions

View File

@ -524,7 +524,10 @@ void MainWindow::setMenus(QString name, QString parentName, QAction* a )
if(a->property("added").toBool())
hasAction = true;
if(!hasAction)
{
ui->menuOperations->removeAction(a);
menu->addAction(a);
}
a->setProperty("added", true);
//If the parent menu already exists, don't create a new one.
if(menu_map.contains(parentName))
@ -540,7 +543,6 @@ void MainWindow::setMenus(QString name, QString parentName, QAction* a )
menu_map[parentName] = parentMenu;
}
parentMenu->addMenu(menu);
ui->menuOperations->removeAction(a);
}
void MainWindow::load_plugin(QString fileName, bool blacklisted)