[frogr] Made FrogrPicture's fileuri property a construct-only one



commit 90d93c04efddd942c44a98e6d171320e1a314670
Author: Mario Sanchez Prada <msanchez gnome org>
Date:   Sat Nov 3 11:16:44 2012 +0100

    Made FrogrPicture's fileuri property a construct-only one

 src/frogr-picture.c |   18 +++---------------
 src/frogr-picture.h |    2 --
 2 files changed, 3 insertions(+), 17 deletions(-)
---
diff --git a/src/frogr-picture.c b/src/frogr-picture.c
index 8d31309..6789943 100644
--- a/src/frogr-picture.c
+++ b/src/frogr-picture.c
@@ -191,6 +191,7 @@ _frogr_picture_set_property (GObject *object,
                              GParamSpec *pspec)
 {
   FrogrPicture *self = FROGR_PICTURE (object);
+  FrogrPicturePrivate *priv = FROGR_PICTURE_GET_PRIVATE (self);
 
   switch (prop_id)
     {
@@ -198,7 +199,7 @@ _frogr_picture_set_property (GObject *object,
       frogr_picture_set_id (self, g_value_get_string (value));
       break;
     case PROP_FILEURI:
-      frogr_picture_set_fileuri (self, g_value_get_string (value));
+      priv->fileuri = g_value_dup_string (value);
       break;
     case PROP_TITLE:
       frogr_picture_set_title (self, g_value_get_string (value));
@@ -413,7 +414,7 @@ frogr_picture_class_init(FrogrPictureClass *klass)
                                                         "Full fileuri at disk "
                                                         "for the picture",
                                                         NULL,
-                                                        G_PARAM_READWRITE));
+                                                        G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
   g_object_class_install_property (obj_class,
                                    PROP_TITLE,
                                    g_param_spec_string ("title",
@@ -650,19 +651,6 @@ frogr_picture_get_fileuri (FrogrPicture *self)
   return (const gchar *)priv->fileuri;
 }
 
-void
-frogr_picture_set_fileuri (FrogrPicture *self,
-                           const gchar *fileuri)
-{
-  FrogrPicturePrivate *priv = NULL;
-
-  g_return_if_fail(FROGR_IS_PICTURE(self));
-
-  priv = FROGR_PICTURE_GET_PRIVATE (self);
-  g_free (priv->fileuri);
-  priv->fileuri = g_strdup (fileuri);
-}
-
 const gchar *
 frogr_picture_get_title (FrogrPicture *self)
 {
diff --git a/src/frogr-picture.h b/src/frogr-picture.h
index 080a071..33c0927 100644
--- a/src/frogr-picture.h
+++ b/src/frogr-picture.h
@@ -77,8 +77,6 @@ void frogr_picture_set_description (FrogrPicture *self,
                                     const gchar *description);
 
 const gchar *frogr_picture_get_fileuri (FrogrPicture *self);
-void frogr_picture_set_fileuri (FrogrPicture *self,
-                                const gchar *fileuri);
 
 const GSList *frogr_picture_get_tags_list (FrogrPicture *self);
 const gchar *frogr_picture_get_tags (FrogrPicture *self);



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