[libgdata] atom: Add a GDATA_LINK_PARENT define



commit 7c2d184ffb1028730965513f487f4f839d206ccc
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Mar 10 22:31:23 2014 +0000

    atom: Add a GDATA_LINK_PARENT define
    
    This is a link type which is included in the GData specification (in the
    RelaxNG schema), but is not documented anywhere. Good job, Google. Best
    for us to define it and allow clients to use it, than to ignore it.
    
    New API:
     • GDATA_LINK_PARENT
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725827

 docs/reference/gdata-sections.txt                |    1 +
 gdata/atom/gdata-link.h                          |   15 +++++++++++++++
 gdata/services/documents/gdata-documents-entry.c |    2 +-
 gdata/tests/documents.c                          |    4 ++--
 4 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/docs/reference/gdata-sections.txt b/docs/reference/gdata-sections.txt
index 4c909ab..c9d65f2 100644
--- a/docs/reference/gdata-sections.txt
+++ b/docs/reference/gdata-sections.txt
@@ -780,6 +780,7 @@ GDATA_LINK_ENCLOSURE
 GDATA_LINK_RELATED
 GDATA_LINK_SELF
 GDATA_LINK_VIA
+GDATA_LINK_PARENT
 GDataLink
 GDataLinkClass
 gdata_link_new
diff --git a/gdata/atom/gdata-link.h b/gdata/atom/gdata-link.h
index 067af88..2bd19e6 100644
--- a/gdata/atom/gdata-link.h
+++ b/gdata/atom/gdata-link.h
@@ -112,6 +112,21 @@ G_BEGIN_DECLS
  **/
 #define GDATA_LINK_EDIT_MEDIA "http://www.iana.org/assignments/relation/edit-media";
 
+/**
+ * GDATA_LINK_PARENT:
+ *
+ * The relation type URI of the of the location of the parent resource in a
+ * hierarchy of entries.
+ *
+ * This is an undocumented GData-specific addition to the Atom specification,
+ * and is not included in the GData documentation except in examples and in the
+ * <ulink type="http" 
url="https://developers.google.com/google-apps/documents-list/v2/schema/document_list_atom.rnc";>
+ * RelaxNG schema</ulink>.
+ *
+ * Since: UNRELEASED
+ */
+#define GDATA_LINK_PARENT "http://schemas.google.com/docs/2007#parent";
+
 #define GDATA_TYPE_LINK                        (gdata_link_get_type ())
 #define GDATA_LINK(o)                  (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_LINK, GDataLink))
 #define GDATA_LINK_CLASS(k)            (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_LINK, GDataLinkClass))
diff --git a/gdata/services/documents/gdata-documents-entry.c 
b/gdata/services/documents/gdata-documents-entry.c
index 5f03e22..6eaa211 100644
--- a/gdata/services/documents/gdata-documents-entry.c
+++ b/gdata/services/documents/gdata-documents-entry.c
@@ -597,7 +597,7 @@ gdata_documents_entry_get_path (GDataDocumentsEntry *self)
        g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), NULL);
 
        path = g_string_new ("/");
-       parent_folders_list = gdata_entry_look_up_links (GDATA_ENTRY (self), 
"http://schemas.google.com/docs/2007#parent";);
+       parent_folders_list = gdata_entry_look_up_links (GDATA_ENTRY (self), GDATA_LINK_PARENT);
 
        /* We check all the folders contained that are parents of the GDataDocumentsEntry */
        for (element = parent_folders_list; element != NULL; element = element->next) {
diff --git a/gdata/tests/documents.c b/gdata/tests/documents.c
index 3b90370..b2ef4f1 100644
--- a/gdata/tests/documents.c
+++ b/gdata/tests/documents.c
@@ -42,7 +42,7 @@ check_document_is_in_folder (GDataDocumentsDocument *document, GDataDocumentsFol
        folder_self_link = gdata_entry_look_up_link (GDATA_ENTRY (folder), GDATA_LINK_SELF);
        g_assert (folder_self_link != NULL);
 
-       for (links = gdata_entry_look_up_links (GDATA_ENTRY (document), 
"http://schemas.google.com/docs/2007#parent";);
+       for (links = gdata_entry_look_up_links (GDATA_ENTRY (document), GDATA_LINK_PARENT);
             links != NULL; links = links->next) {
                GDataLink *_link = GDATA_LINK (links->data);
 
@@ -62,7 +62,7 @@ check_document_is_in_root_folder (GDataDocumentsDocument *document)
        GList *links;
        gboolean is_in_root_folder;
 
-       links = gdata_entry_look_up_links (GDATA_ENTRY (document), 
"http://schemas.google.com/docs/2007#parent";);
+       links = gdata_entry_look_up_links (GDATA_ENTRY (document), GDATA_LINK_PARENT);
        is_in_root_folder = (links == NULL) ? TRUE : FALSE;
        g_list_free (links);
 


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