diff options
Diffstat (limited to 'gdata/services/documents/gdata-documents-entry.c')
-rw-r--r-- | gdata/services/documents/gdata-documents-entry.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gdata/services/documents/gdata-documents-entry.c b/gdata/services/documents/gdata-documents-entry.c index 1965a652..20a61f3e 100644 --- a/gdata/services/documents/gdata-documents-entry.c +++ b/gdata/services/documents/gdata-documents-entry.c @@ -615,6 +615,7 @@ _gdata_documents_entry_download_document (GDataDocumentsEntry *self, GDataServic GInputStream *src_stream; GFile *actual_file = NULL; GError *child_error = NULL; + gulong content_type_signal = 0; /* TODO: async version */ g_return_val_if_fail (GDATA_IS_DOCUMENTS_ENTRY (self), NULL); @@ -646,8 +647,13 @@ _gdata_documents_entry_download_document (GDataDocumentsEntry *self, GDataServic src_stream = gdata_download_stream_new (GDATA_SERVICE (service), src_uri); if (content_type != NULL) g_signal_connect (src_stream, "notify::content-type", (GCallback) notify_content_type_cb, content_type); + g_output_stream_splice (G_OUTPUT_STREAM (dest_stream), src_stream, G_OUTPUT_STREAM_SPLICE_CLOSE_SOURCE | G_OUTPUT_STREAM_SPLICE_CLOSE_TARGET, cancellable, &child_error); + + if (content_type_signal != 0) + g_signal_handler_disconnect (src_stream, content_type_signal); + g_object_unref (src_stream); g_object_unref (dest_stream); if (child_error != NULL) { |