[clutter/clutter-1.14] cally: Use AktObject::get_name()



commit 38627bed72bf969dd0d926d49e1f650e93e54621
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Wed Feb 20 23:30:21 2013 +0000

    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.

 clutter/cally/cally-root.c |   33 ++++++++++++++++++++-------------
 1 files changed, 20 insertions(+), 13 deletions(-)
---
diff --git a/clutter/cally/cally-root.c b/clutter/cally/cally-root.c
index 3b9ff87..ee921dc 100644
--- a/clutter/cally/cally-root.c
+++ b/clutter/cally/cally-root.c
@@ -42,20 +42,21 @@
 static void cally_root_finalize   (GObject *object);
 
 /* AtkObject.h */
-static void       cally_root_initialize                            (AtkObject *accessible,
-                                                                    gpointer   data);
-static gint       cally_root_get_n_children                        (AtkObject *obj);
-static AtkObject *cally_root_ref_child                             (AtkObject *obj,
-                                                                    gint i);
-static AtkObject *cally_root_get_parent                            (AtkObject *obj);
+static void             cally_root_initialize           (AtkObject *accessible,
+                                                         gpointer   data);
+static gint             cally_root_get_n_children       (AtkObject *obj);
+static AtkObject *      cally_root_ref_child            (AtkObject *obj,
+                                                         gint i);
+static AtkObject *      cally_root_get_parent           (AtkObject *obj);
+static const char *     cally_root_get_name             (AtkObject *obj);
 
 /* Private */
-static void       cally_util_stage_added_cb                        (ClutterStageManager *stage_manager,
-                                                                    ClutterStage *stage,
-                                                                    gpointer data);
-static void       cally_util_stage_removed_cb                      (ClutterStageManager *stage_manager,
-                                                                    ClutterStage *stage,
-                                                                    gpointer data);
+static void             cally_util_stage_added_cb       (ClutterStageManager *stage_manager,
+                                                         ClutterStage *stage,
+                                                         gpointer data);
+static void             cally_util_stage_removed_cb     (ClutterStageManager *stage_manager,
+                                                         ClutterStage *stage,
+                                                         gpointer data);
 
 #define CALLY_ROOT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CALLY_TYPE_ROOT, CallyRootPrivate))
 
@@ -89,6 +90,7 @@ cally_root_class_init (CallyRootClass *klass)
   class->ref_child = cally_root_ref_child;
   class->get_parent = cally_root_get_parent;
   class->initialize = cally_root_initialize;
+  class->get_name = cally_root_get_name;
 
   g_type_class_add_private (gobject_class, sizeof (CallyRootPrivate));
 }
@@ -167,7 +169,6 @@ cally_root_initialize (AtkObject              *accessible,
   CallyRoot           *root          = NULL;
 
   accessible->role = ATK_ROLE_APPLICATION;
-  accessible->name = g_strdup (g_get_prgname());
   accessible->accessible_parent = NULL;
 
   /* children initialization */
@@ -238,6 +239,12 @@ cally_root_get_parent (AtkObject *obj)
   return NULL;
 }
 
+static const char *
+cally_root_get_name (AtkObject *obj)
+{
+  return g_get_prgname ();
+}
+
 /* -------------------------------- PRIVATE --------------------------------- */
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]