[libgdata/wip/rishi/drive: 4/9] core: Parse alternateLink from JSON
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata/wip/rishi/drive: 4/9] core: Parse alternateLink from JSON
- Date: Fri, 17 Apr 2015 08:57:05 +0000 (UTC)
commit d90826826214e46c97585bdcfff68581cd719317
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Mar 31 18:54:58 2015 +0200
core: Parse alternateLink from JSON
https://bugzilla.gnome.org/show_bug.cgi?id=684920
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 b52ac32..56b335b 100644
--- a/gdata/gdata-entry.c
+++ b/gdata/gdata-entry.c
@@ -617,6 +617,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]