]> Pileus Git - ~andy/gtk/commitdiff
a11y: Store the cellinfo in the cell's qdata
authorBenjamin Otte <otte@redhat.com>
Fri, 11 Nov 2011 19:06:20 +0000 (20:06 +0100)
committerBenjamin Otte <otte@redhat.com>
Wed, 16 Nov 2011 03:39:22 +0000 (04:39 +0100)
gtk/a11y/gtktreeviewaccessible.c

index 1b6167f25974c751bf56b19a70fe414fb45f436a..cd0390bb06c7f735e664bc46799abc53cd5e3843 100644 (file)
@@ -2702,6 +2702,17 @@ iterate_thru_children (GtkTreeView  *tree_view,
   return;
 }
 
+static GQuark
+gtk_tree_view_accessible_get_data_quark (void)
+{
+  static GQuark quark = 0;
+
+  if (G_UNLIKELY (quark == 0))
+    quark = g_quark_from_static_string ("gtk-tree-view-accessible-data");
+
+  return quark;
+}
+
 static void
 clean_cell_info (GtkTreeViewAccessible         *accessible,
                  GtkTreeViewAccessibleCellInfo *cell_info)
@@ -2713,7 +2724,9 @@ clean_cell_info (GtkTreeViewAccessible         *accessible,
       obj = G_OBJECT (cell_info->cell);
 
       _gtk_cell_accessible_add_state (cell_info->cell, ATK_STATE_DEFUNCT, FALSE);
-      g_object_weak_unref (obj, (GWeakNotify) cell_destroyed, cell_info);
+      g_object_set_qdata (obj,
+                          gtk_tree_view_accessible_get_data_quark (),
+                          NULL);
       cell_info->in_use = FALSE;
       if (!accessible->garbage_collection_pending)
         {
@@ -3181,8 +3194,10 @@ cell_info_new (GtkTreeViewAccessible *accessible,
   cell_info->view = accessible;
   g_hash_table_insert (accessible->cell_info_by_index, cell, cell_info);
 
-  /* Setup weak reference notification */
-  g_object_weak_ref (G_OBJECT (cell), (GWeakNotify) cell_destroyed, cell_info);
+  g_object_set_qdata_full (G_OBJECT (cell), 
+                           gtk_tree_view_accessible_get_data_quark (),
+                           cell_info,
+                           cell_destroyed);
 }
 
 static GtkCellAccessible *