diff options
author | Debarshi Ray <debarshir@gnome.org> | 2016-09-21 17:33:42 +0200 |
---|---|---|
committer | Debarshi Ray <debarshir@gnome.org> | 2016-09-21 19:50:05 +0200 |
commit | 16e601b7c832cbc1e945a7bd9fda61ee2e80299d (patch) | |
tree | c4e2396fbc1aec1482003fee720681fb80dbabf3 | |
parent | a9a2c4be51ecb4c665a349401097ff88636557bc (diff) | |
download | libgdata-16e601b7c832cbc1e945a7bd9fda61ee2e80299d.tar.gz |
documents: Retain the content type when adding an entry to a folder
Otherwise, it will be identified as application/octet-stream and
exportLinks will be missing.
https://bugzilla.gnome.org/show_bug.cgi?id=684920
-rw-r--r-- | gdata/services/documents/gdata-documents-service.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gdata/services/documents/gdata-documents-service.c b/gdata/services/documents/gdata-documents-service.c index 48ad8b65..2e7b146a 100644 --- a/gdata/services/documents/gdata-documents-service.c +++ b/gdata/services/documents/gdata-documents-service.c @@ -3,7 +3,7 @@ * GData Client * Copyright (C) Thibault Saunier 2009 <saunierthibault@gmail.com> * Copyright (C) Philip Withnall 2010, 2014 <philip@tecnocode.co.uk> - * Copyright (C) Red Hat, Inc. 2015 + * Copyright (C) Red Hat, Inc. 2015, 2016 * * GData Client is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -1140,6 +1140,7 @@ gdata_documents_service_add_entry_to_folder (GDataDocumentsService *self, GDataD GDataDocumentsEntry *local_entry; GDataOperationType operation_type; GType entry_type; + const gchar *content_type; const gchar *etag; const gchar *title; const gchar *uri_prefix = "https://www.googleapis.com/drive/v2/files"; @@ -1173,9 +1174,11 @@ gdata_documents_service_add_entry_to_folder (GDataDocumentsService *self, GDataD } entry_type = G_OBJECT_TYPE (entry); + content_type = gdata_documents_utils_get_content_type (entry); etag = gdata_entry_get_etag (GDATA_ENTRY (entry)); title = gdata_entry_get_title (GDATA_ENTRY (entry)); local_entry = g_object_new (entry_type, "etag", etag, "title", title, NULL); + gdata_documents_utils_add_content_type (local_entry, content_type); add_folder_link_to_entry (local_entry, folder); message = _gdata_service_build_message (GDATA_SERVICE (self), get_documents_authorization_domain (), SOUP_METHOD_POST, uri, NULL, FALSE); |