aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-02-14 18:25:48 +0100
committerJavier <dev.git@javispedro.com>2015-02-14 18:25:48 +0100
commit05836ea6fd9c2df12748d3de9489b35583bc5c85 (patch)
tree1b014a0d20f15bda357b66678ddf1cfcc0927128
parenta88a02bde7401c566ee79f95b5ea7e9011332ffd (diff)
downloadtopmenu-qt-05836ea6fd9c2df12748d3de9489b35583bc5c85.tar.gz
topmenu-qt-05836ea6fd9c2df12748d3de9489b35583bc5c85.zip
remove contained actions when removing a menu from the proxy
-rw-r--r--module/menuproxy.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/module/menuproxy.cc b/module/menuproxy.cc
index 01a2b6f..d2a757d 100644
--- a/module/menuproxy.cc
+++ b/module/menuproxy.cc
@@ -202,6 +202,11 @@ void MenuProxy::removeMenu(QMenu *menu)
GtkMenu *g_parent = GTK_MENU(gtk_widget_get_parent(g_item));
Q_ASSERT(g_parent);
+ // Does it contain any actions? Should remove those now
+ foreach (QAction *action, menu->actions()) {
+ removeAction(action);
+ }
+
menu->removeEventFilter(this);
gtk_widget_destroy(GTK_WIDGET(g_menu));