[libgdata/libgdata-0-5: 4/8] Bug 598893 — gdata_picasaweb_album_new doesn't set a valid visibility



commit 2b5d773c0d6deff680f2b5b701ee312e1ea6d5ed
Author: Richard Schwarting <aquarichy gmail com>
Date:   Sat Oct 24 10:40:00 2009 +0100

    Bug 598893 â?? gdata_picasaweb_album_new doesn't set a valid visibility
    
    Set GDataPicasaWebAlbum:visibility to private when creating a new album.
    Closes: bgo#598893

 gdata/services/picasaweb/gdata-picasaweb-album.c |    1 +
 gdata/tests/picasaweb.c                          |   31 ++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/gdata/services/picasaweb/gdata-picasaweb-album.c b/gdata/services/picasaweb/gdata-picasaweb-album.c
index 464a1ee..af9371e 100644
--- a/gdata/services/picasaweb/gdata-picasaweb-album.c
+++ b/gdata/services/picasaweb/gdata-picasaweb-album.c
@@ -430,6 +430,7 @@ 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;
 
 	/* Connect to the notify::title signal from GDataEntry so our media:group title can be kept in sync */
 	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 2fb2ae0..de57785 100644
--- a/gdata/tests/picasaweb.c
+++ b/gdata/tests/picasaweb.c
@@ -617,6 +617,36 @@ test_query_all_albums_async (GDataService *service)
 	g_main_loop_unref (main_loop);
 }
 
+static void
+test_album_new (GDataService *service)
+{
+	GDataPicasaWebAlbum *album;
+	gchar *xml;
+
+	g_test_bug ("598893");
+
+	album = gdata_picasaweb_album_new ("some-id");
+
+	xml = gdata_parsable_get_xml (GDATA_PARSABLE (album));
+	g_assert_cmpstr (xml, ==,
+			 "<entry xmlns='http://www.w3.org/2005/Atom' "
+				"xmlns:gphoto='http://schemas.google.com/photos/2007' "
+				"xmlns:media='http://search.yahoo.com/mrss/' "
+				"xmlns:gd='http://schemas.google.com/g/2005' "
+				"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>"
+				"<id>some-id</id>"
+				"<gphoto:access>private</gphoto:access>"
+				"<gphoto:commentingEnabled>false</gphoto:commentingEnabled>"
+				"<media:group/>"
+			 "</entry>");
+
+	g_free (xml);
+	g_object_unref (album);
+}
+
 /* TODO: test private, public albums, test uploading */
 /* TODO: add queries to update albums, files on the server; test those */
 
@@ -647,6 +677,7 @@ main (int argc, char *argv[])
 	g_test_add_data_func ("/picasaweb/query/photo_feed", service, test_photo_feed);
 	g_test_add_data_func ("/picasaweb/query/photo_feed_entry", service, test_photo_feed_entry);
 	g_test_add_data_func ("/picasaweb/query/photo", service, test_photo);
+	g_test_add_data_func ("/picasaweb/album/new", service, test_album_new);
 
 	retval = g_test_run ();
 	g_object_unref (service);



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