[libgdata/wip/rishi/drive: 4/4] core: Parse alternateLink from JSON



commit ef28248be17c1105fda6e9586ab57fa0b12baa82
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Mar 31 18:54:58 2015 +0200

    core: Parse alternateLink from JSON

 gdata/gdata-entry.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/gdata/gdata-entry.c b/gdata/gdata-entry.c
index be242e5..6193dc8 100644
--- a/gdata/gdata-entry.c
+++ b/gdata/gdata-entry.c
@@ -616,6 +616,21 @@ parse_json (GDataParsable *parsable, JsonReader *reader, gpointer user_data, GEr
                g_object_unref (_link);
 
                return TRUE;
+       } else if (g_strcmp0 (json_reader_get_member_name (reader), "alternateLink") == 0) {
+               GDataLink *_link;
+               const gchar *uri;
+
+               /* Empty URI? */
+               uri = json_reader_get_string_value (reader);
+               if (uri == NULL || *uri == '\0') {
+                       return gdata_parser_error_required_json_content_missing (reader, error);
+               }
+
+               _link = gdata_link_new (uri, GDATA_LINK_ALTERNATE);
+               gdata_entry_add_link (GDATA_ENTRY (parsable), _link);
+               g_object_unref (_link);
+
+               return TRUE;
        } else if (g_strcmp0 (json_reader_get_member_name (reader), "kind") == 0) {
                GDataCategory *category;
                const gchar *kind;


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