[gnome-photos] base-item: Invoke populate_from_cursor in constructed
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] base-item: Invoke populate_from_cursor in constructed
- Date: Sun, 15 Jul 2012 20:15:33 +0000 (UTC)
commit f3ae3484e891a51be5f3e940a32fda5f00650683
Author: Debarshi Ray <debarshir gnome org>
Date: Sun Jul 15 19:04:46 2012 +0200
base-item: Invoke populate_from_cursor in constructed
... because it depends on the other properties.
src/photos-base-item.c | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 2e8cb44..db451b6 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -34,6 +34,7 @@ struct _PhotosBaseItemPrivate
{
GdkPixbuf *icon;
GdkPixbuf *pristine_icon;
+ TrackerSparqlCursor *cursor;
gboolean failed_thumbnailing;
gboolean favorite;
gboolean thumbnailed;
@@ -447,6 +448,19 @@ photos_base_item_update_type_description (PhotosBaseItem *self)
static void
+photos_base_item_constructed (GObject *object)
+{
+ PhotosBaseItem *self = PHOTOS_BASE_ITEM (object);
+ PhotosBaseItemPrivate *priv = self->priv;
+
+ G_OBJECT_CLASS (photos_base_item_parent_class)->constructed (object);
+
+ photos_base_item_populate_from_cursor (self, priv->cursor);
+ g_clear_object (&priv->cursor); /* We will not need it any more */
+}
+
+
+static void
photos_base_item_dispose (GObject *object)
{
PhotosBaseItem *self = PHOTOS_BASE_ITEM (object);
@@ -454,6 +468,7 @@ photos_base_item_dispose (GObject *object)
g_clear_object (&priv->icon);
g_clear_object (&priv->pristine_icon);
+ g_clear_object (&priv->cursor);
G_OBJECT_CLASS (photos_base_item_parent_class)->dispose (object);
}
@@ -506,7 +521,7 @@ photos_base_item_set_property (GObject *object, guint prop_id, const GValue *val
switch (prop_id)
{
case PROP_CURSOR:
- photos_base_item_populate_from_cursor (self, TRACKER_SPARQL_CURSOR (g_value_get_object (value)));
+ priv->cursor = TRACKER_SPARQL_CURSOR (g_value_dup_object (value));
break;
case PROP_FAILED_THUMBNAILING:
@@ -539,6 +554,7 @@ photos_base_item_class_init (PhotosBaseItemClass *class)
{
GObjectClass *object_class = G_OBJECT_CLASS (class);
+ object_class->constructed= photos_base_item_constructed;
object_class->dispose = photos_base_item_dispose;
object_class->finalize = photos_base_item_finalize;
object_class->get_property = photos_base_item_get_property;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]