[libgdata/wip/rishi/drive: 4/7] core: Parse alternateLink from JSON
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata/wip/rishi/drive: 4/7] core: Parse alternateLink from JSON
- Date: Thu, 16 Apr 2015 14:53:56 +0000 (UTC)
commit 8934a45f4c642bbe95cb7ff710fed7f5f135d13d
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 74cae0e..30af836 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]