mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 05:01:09 +00:00
Warn on duplicate action group names. (#501746, Christian Persch)
2008-02-15 Matthias Clasen <mclasen@redhat.com> * gtk/gtkuimanager.c (gtk_ui_manager_insert_action_group): Warn on duplicate action group names. (#501746, Christian Persch) svn path=/trunk/; revision=19592
This commit is contained in:
parent
ca36ffc2af
commit
34418c4e8e
@ -1,3 +1,9 @@
|
|||||||
|
2008-02-15 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
|
* gtk/gtkuimanager.c (gtk_ui_manager_insert_action_group):
|
||||||
|
Warn on duplicate action group names. (#501746, Christian
|
||||||
|
Persch)
|
||||||
|
|
||||||
2008-02-15 Matthias Clasen <mclasen@redhat.com>
|
2008-02-15 Matthias Clasen <mclasen@redhat.com>
|
||||||
|
|
||||||
* gtk/Makefile.am:
|
* gtk/Makefile.am:
|
||||||
|
@ -696,11 +696,32 @@ gtk_ui_manager_insert_action_group (GtkUIManager *self,
|
|||||||
GtkActionGroup *action_group,
|
GtkActionGroup *action_group,
|
||||||
gint pos)
|
gint pos)
|
||||||
{
|
{
|
||||||
|
#ifdef G_ENABLE_DEBUG
|
||||||
|
GList *l;
|
||||||
|
const char *group_name;
|
||||||
|
#endif
|
||||||
|
|
||||||
g_return_if_fail (GTK_IS_UI_MANAGER (self));
|
g_return_if_fail (GTK_IS_UI_MANAGER (self));
|
||||||
g_return_if_fail (GTK_IS_ACTION_GROUP (action_group));
|
g_return_if_fail (GTK_IS_ACTION_GROUP (action_group));
|
||||||
g_return_if_fail (g_list_find (self->private_data->action_groups,
|
g_return_if_fail (g_list_find (self->private_data->action_groups,
|
||||||
action_group) == NULL);
|
action_group) == NULL);
|
||||||
|
|
||||||
|
#ifdef G_ENABLE_DEBUG
|
||||||
|
group_name = gtk_action_group_get_name (action_group);
|
||||||
|
|
||||||
|
for (l = self->private_data->action_groups; l; l = l->next)
|
||||||
|
{
|
||||||
|
GtkActionGroup *group = l->data;
|
||||||
|
|
||||||
|
if (strcmp (gtk_action_group_get_name (group), group_name) == 0)
|
||||||
|
{
|
||||||
|
g_warning ("Inserting action group '%s' into UI manager which "
|
||||||
|
"already has a group with this name\n", group_name);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* G_ENABLE_DEBUG */
|
||||||
|
|
||||||
g_object_ref (action_group);
|
g_object_ref (action_group);
|
||||||
self->private_data->action_groups =
|
self->private_data->action_groups =
|
||||||
g_list_insert (self->private_data->action_groups, action_group, pos);
|
g_list_insert (self->private_data->action_groups, action_group, pos);
|
||||||
|
Loading…
Reference in New Issue
Block a user