[libgdata/wip/rishi/drive] documents: Use JSON for uploading files via Drive v2



commit 266345dbec0bded240868f2a00324f55f7e09d9c
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Jun 12 13:27:04 2015 +0200

    documents: Use JSON for uploading files via Drive v2
    
    This is enough to upload a file to the root folder. You can't upload
    it to a specific location.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684920

 gdata/services/documents/gdata-documents-entry.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gdata/services/documents/gdata-documents-entry.c 
b/gdata/services/documents/gdata-documents-entry.c
index f107c61..e149cec 100644
--- a/gdata/services/documents/gdata-documents-entry.c
+++ b/gdata/services/documents/gdata-documents-entry.c
@@ -115,6 +115,7 @@
 static void gdata_documents_entry_access_handler_init (GDataAccessHandlerIface *iface);
 static void gdata_documents_entry_finalize (GObject *object);
 static void gdata_entry_dispose (GObject *object);
+static const gchar *get_content_type (void);
 static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces);
 static void gdata_documents_entry_get_property (GObject *object, guint property_id, GValue *value, 
GParamSpec *pspec);
 static void gdata_documents_entry_set_property (GObject *object, guint property_id, const GValue *value, 
GParamSpec *pspec);
@@ -162,6 +163,7 @@ gdata_documents_entry_class_init (GDataDocumentsEntryClass *klass)
 
        parsable_class->parse_json = parse_json;
        parsable_class->post_parse_json = post_parse_json;
+       parsable_class->get_content_type = get_content_type;
        parsable_class->get_namespaces = get_namespaces;
 
        entry_class->get_entry_uri = get_entry_uri;
@@ -789,6 +791,12 @@ post_parse_json (GDataParsable *parsable, gpointer user_data, GError **error)
        return TRUE;
 }
 
+static const gchar *
+get_content_type (void)
+{
+       return "application/json";
+}
+
 static void
 get_namespaces (GDataParsable *parsable, GHashTable *namespaces)
 {


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