a11y: Implement get_name() instead of setting variables

This avoids a later free of this const value.
This commit is contained in:
Benjamin Otte 2013-01-13 18:50:16 +01:00
parent 1205e3b043
commit f260affbb8

View File

@ -44,7 +44,6 @@ gtk_toplevel_accessible_initialize (AtkObject *accessible,
ATK_OBJECT_CLASS (gtk_toplevel_accessible_parent_class)->initialize (accessible, data); ATK_OBJECT_CLASS (gtk_toplevel_accessible_parent_class)->initialize (accessible, data);
accessible->role = ATK_ROLE_APPLICATION; accessible->role = ATK_ROLE_APPLICATION;
accessible->name = g_get_prgname ();
accessible->accessible_parent = NULL; accessible->accessible_parent = NULL;
} }
@ -87,6 +86,12 @@ gtk_toplevel_accessible_ref_child (AtkObject *obj,
return atk_obj; return atk_obj;
} }
static const char *
gtk_toplevel_accessible_get_name (AtkObject *obj)
{
return g_get_prgname ();
}
static gboolean static gboolean
is_combo_window (GtkWidget *widget) is_combo_window (GtkWidget *widget)
{ {
@ -143,6 +148,7 @@ gtk_toplevel_accessible_class_init (GtkToplevelAccessibleClass *klass)
class->get_n_children = gtk_toplevel_accessible_get_n_children; class->get_n_children = gtk_toplevel_accessible_get_n_children;
class->ref_child = gtk_toplevel_accessible_ref_child; class->ref_child = gtk_toplevel_accessible_ref_child;
class->get_parent = NULL; class->get_parent = NULL;
class->get_name = gtk_toplevel_accessible_get_name;
g_object_class->finalize = gtk_toplevel_accessible_object_finalize; g_object_class->finalize = gtk_toplevel_accessible_object_finalize;