[libgdata] picasaweb: Ensure the rights of an album are correctly initialised to private
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata] picasaweb: Ensure the rights of an album are correctly initialised to private
- Date: Fri, 24 Jun 2011 18:39:55 +0000 (UTC)
commit 0c75897a59a9d0d0616cf7627d313fffdf08d9be
Author: Philip Withnall <philip tecnocode co uk>
Date: Thu Jun 23 16:00:44 2011 +0100
picasaweb: Ensure the rights of an album are correctly initialised to private
Previously, the default value of the âvisibilityâ property wasn't set
properly, and the GDataEntry:rights property (which is aliased with
GDataPicasaWebAlbum:visibility) wasn't set to private on initialisation.
gdata/services/picasaweb/gdata-picasaweb-album.c | 7 +++++--
gdata/tests/picasaweb.c | 2 ++
2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gdata/services/picasaweb/gdata-picasaweb-album.c b/gdata/services/picasaweb/gdata-picasaweb-album.c
index c33f004..a5a93d0 100644
--- a/gdata/services/picasaweb/gdata-picasaweb-album.c
+++ b/gdata/services/picasaweb/gdata-picasaweb-album.c
@@ -265,7 +265,7 @@ gdata_picasaweb_album_class_init (GDataPicasaWebAlbumClass *klass)
g_object_class_install_property (gobject_class, PROP_VISIBILITY,
g_param_spec_enum ("visibility",
"Visibility", "The visibility (or access rights) of the album.",
- GDATA_TYPE_PICASAWEB_VISIBILITY, GDATA_PICASAWEB_PUBLIC,
+ GDATA_TYPE_PICASAWEB_VISIBILITY, GDATA_PICASAWEB_PRIVATE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
/**
@@ -480,10 +480,13 @@ gdata_picasaweb_album_init (GDataPicasaWebAlbum *self)
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GDATA_TYPE_PICASAWEB_ALBUM, GDataPicasaWebAlbumPrivate);
self->priv->media_group = g_object_new (GDATA_TYPE_MEDIA_GROUP, NULL);
self->priv->georss_where = g_object_new (GDATA_TYPE_GEORSS_WHERE, NULL);
- self->priv->visibility = GDATA_PICASAWEB_PRIVATE;
self->priv->edited = -1;
self->priv->timestamp = -1;
+ /* Set the initial visibility */
+ self->priv->visibility = GDATA_PICASAWEB_PRIVATE;
+ gdata_entry_set_rights (GDATA_ENTRY (self), "private");
+
/* Connect to the notify::title signal from GDataEntry so our media:group title can be kept in sync
* (the title of an album is duplicated in atom:title and media:group/media:title) */
g_signal_connect (GDATA_ENTRY (self), "notify::title", G_CALLBACK (notify_title_cb), NULL);
diff --git a/gdata/tests/picasaweb.c b/gdata/tests/picasaweb.c
index fbf99e4..09e57b8 100644
--- a/gdata/tests/picasaweb.c
+++ b/gdata/tests/picasaweb.c
@@ -1546,6 +1546,7 @@ test_album_new (void)
"xmlns:georss='http://www.georss.org/georss' ?){7}>"
"<title type='text'></title>"
"<id>http://picasaweb.google.com/data/entry/user/libgdata.picasaweb/albumid/5328889949261497249</id>"
+ "<rights>private</rights>"
"<category term='http://schemas.google.com/photos/2007#album' "
"scheme='http://schemas.google.com/g/2005#kind'/>"
"<gphoto:id>5328889949261497249</gphoto:id>"
@@ -1605,6 +1606,7 @@ test_album_escaping (void)
"xmlns:gml='http://www.opengis.net/gml' xmlns:app='http://www.w3.org/2007/app' "
"xmlns:georss='http://www.georss.org/georss'>"
"<title type='text'></title>"
+ "<rights>private</rights>"
"<category term='http://schemas.google.com/photos/2007#album' scheme='http://schemas.google.com/g/2005#kind'/>"
"<gphoto:id><id></gphoto:id>"
"<gphoto:location>Everywhere & nowhere</gphoto:location>"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]