aboutsummaryrefslogtreecommitdiff
path: root/module
diff options
context:
space:
mode:
Diffstat (limited to 'module')
-rw-r--r--module/menuproxy.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/module/menuproxy.cc b/module/menuproxy.cc
index a59a576..81ba1d7 100644
--- a/module/menuproxy.cc
+++ b/module/menuproxy.cc
@@ -82,7 +82,12 @@ GtkMenuItem * MenuProxy::addAction(QAction* action, QAction* before, QMenu* pare
g_parent = m_target;
}
- GtkMenuItem *item;
+ GtkMenuItem *item = getItemForAction(action);
+ if (item) {
+ // Action is already on this proxy.
+ return item;
+ }
+
if (action->isSeparator()) {
item = GTK_MENU_ITEM(gtk_separator_menu_item_new());
} else if (action->isCheckable()) {
@@ -163,6 +168,7 @@ void MenuProxy::removeAction(QAction *action)
GtkMenuItem *item = m_items.value(action);
if (!item) {
+ // Action is not on this proxy
return;
}