GNOME Bugzilla – Bug 150877
should warn about duplicate actions
Last modified: 2007-05-19 04:06:35 UTC
GtkUIManager and/or GtkActionGroup should warn when inserting duplicate actions with the same name. Doing so apparently confuses gtk_ui_manager_remove_ui() (see bug 150803)
Created attachment 85008 [details] [review] Patch to refuse duplicate actions This patch makes GtkActionGroup refuse to accept non-unique actions and emit a warning about it. Also modifies the testactions tester to have duplicate actions in the action entries to test this. Internally the actions are kept in a hash table, keyed with the action name. So currently, if one adds a duplicate action to the group, the old one will get discarded. This seems to confuse GtkUIManager a bit as seen in bug 150803 (I guess that the signal gets emitted for the action that had been discarded, but had refcount > 1 at that time and was kept a pointer to within uimanager). As actions are identified primarily by their name, rejecting duplicates seems to be the right thing to do conceptually too.
*** This bug has been marked as a duplicate of 362578 ***
Arg, sorry for fumbling around
2007-05-18 Matthias Clasen <mclasen@redhat.com> * gtk/gtkactiongroup.c: Warn and refuse to add actions with duplicate names. (#150877, Tommi Komulainen)