From 3f40a603959e13e17b0198ff46b11e05ca4043ff Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Thu, 8 Sep 2016 14:47:04 +0200 Subject: [PATCH] Fix - 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. --- Polyhedron/demo/Polyhedron/MainWindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/MainWindow.cpp b/Polyhedron/demo/Polyhedron/MainWindow.cpp index f9a38484c65..b55b4f340da 100644 --- a/Polyhedron/demo/Polyhedron/MainWindow.cpp +++ b/Polyhedron/demo/Polyhedron/MainWindow.cpp @@ -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)