[gnome-control-center] background: Use objects for CcBackgroundItem storage
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] background: Use objects for CcBackgroundItem storage
- Date: Mon, 14 Feb 2011 19:11:38 +0000 (UTC)
commit db0b5b1195a4fea930871143e9326b517b748ddf
Author: Bastien Nocera <hadess hadess net>
Date: Mon Feb 14 18:11:04 2011 +0000
background: Use objects for CcBackgroundItem storage
So that we don't need to unref the items in the list store by hand.
panels/background/background.ui | 2 +-
panels/background/bg-source.c | 20 +-------------------
2 files changed, 2 insertions(+), 20 deletions(-)
---
diff --git a/panels/background/background.ui b/panels/background/background.ui
index a1ccfbf..ee475d7 100644
--- a/panels/background/background.ui
+++ b/panels/background/background.ui
@@ -7,7 +7,7 @@
<!-- column-name gicon -->
<column type="GIcon"/>
<!-- column-name data -->
- <column type="gpointer"/>
+ <column type="GObject"/>
<!-- column-name source-id -->
<column type="guint"/>
</columns>
diff --git a/panels/background/bg-source.c b/panels/background/bg-source.c
index 6b81eee..240a154 100644
--- a/panels/background/bg-source.c
+++ b/panels/background/bg-source.c
@@ -70,22 +70,6 @@ bg_source_set_property (GObject *object,
}
}
-static gboolean
-free_tree_model_items (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data)
-{
- CcBackgroundItem *item = NULL;
-
- gtk_tree_model_get (model, iter, 1, &item, -1);
-
- if (item)
- g_object_unref (item);
-
- return FALSE;
-}
-
static void
bg_source_dispose (GObject *object)
{
@@ -93,8 +77,6 @@ bg_source_dispose (GObject *object)
if (priv->store)
{
- gtk_tree_model_foreach (GTK_TREE_MODEL (priv->store),
- free_tree_model_items, NULL);
g_object_unref (priv->store);
priv->store = NULL;
}
@@ -136,7 +118,7 @@ bg_source_init (BgSource *self)
priv = self->priv = SOURCE_PRIVATE (self);
- priv->store = gtk_list_store_new (2, G_TYPE_ICON, G_TYPE_POINTER);
+ priv->store = gtk_list_store_new (2, G_TYPE_ICON, G_TYPE_OBJECT);
}
GtkListStore*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]