cally: Use AktObject::get_name()

Instead of directly accessing the instance fields. This removes a
compiler warning after the constification of g_get_prgname(), and it
seems to me to be generally more correct.
This commit is contained in:
Emmanuele Bassi 2013-02-20 23:30:21 +00:00
parent 01ba68ad3b
commit 1a0bbbaf54

View File

@ -45,9 +45,10 @@ static void cally_root_finalize (GObject *object);
static void cally_root_initialize (AtkObject *accessible, static void cally_root_initialize (AtkObject *accessible,
gpointer data); gpointer data);
static gint cally_root_get_n_children (AtkObject *obj); static gint cally_root_get_n_children (AtkObject *obj);
static AtkObject *cally_root_ref_child (AtkObject *obj, static AtkObject * cally_root_ref_child (AtkObject *obj,
gint i); gint i);
static AtkObject *cally_root_get_parent (AtkObject *obj); static AtkObject * cally_root_get_parent (AtkObject *obj);
static const char * cally_root_get_name (AtkObject *obj);
/* Private */ /* Private */
static void cally_util_stage_added_cb (ClutterStageManager *stage_manager, static void cally_util_stage_added_cb (ClutterStageManager *stage_manager,
@ -89,6 +90,7 @@ cally_root_class_init (CallyRootClass *klass)
class->ref_child = cally_root_ref_child; class->ref_child = cally_root_ref_child;
class->get_parent = cally_root_get_parent; class->get_parent = cally_root_get_parent;
class->initialize = cally_root_initialize; class->initialize = cally_root_initialize;
class->get_name = cally_root_get_name;
g_type_class_add_private (gobject_class, sizeof (CallyRootPrivate)); g_type_class_add_private (gobject_class, sizeof (CallyRootPrivate));
} }
@ -167,7 +169,6 @@ cally_root_initialize (AtkObject *accessible,
CallyRoot *root = NULL; CallyRoot *root = NULL;
accessible->role = ATK_ROLE_APPLICATION; accessible->role = ATK_ROLE_APPLICATION;
accessible->name = g_get_prgname();
accessible->accessible_parent = NULL; accessible->accessible_parent = NULL;
/* children initialization */ /* children initialization */
@ -238,6 +239,12 @@ cally_root_get_parent (AtkObject *obj)
return NULL; return NULL;
} }
static const char *
cally_root_get_name (AtkObject *obj)
{
return g_get_prgname ();
}
/* -------------------------------- PRIVATE --------------------------------- */ /* -------------------------------- PRIVATE --------------------------------- */
static void static void