[libgdata] Bug 590568 – Crash on querying inside a folder



commit 6d5a2712416a2f70e87b47a2efe6f9abfdb1ee36
Author: Thibault Saunier <saunierthibault gmail com>
Date:   Sat Aug 8 16:29:50 2009 +0100

    Bug 590568 â?? Crash on querying inside a folder
    
    Re-fix queries in folders to use the correct URI as per the API change on
    2009-08-03 (http://code.google.com/apis/documents/changelog.html).

 gdata/services/documents/gdata-documents-service.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/gdata/services/documents/gdata-documents-service.c b/gdata/services/documents/gdata-documents-service.c
index d633504..bd8aefe 100644
--- a/gdata/services/documents/gdata-documents-service.c
+++ b/gdata/services/documents/gdata-documents-service.c
@@ -189,8 +189,16 @@ gdata_documents_service_query_documents (GDataDocumentsService *self, GDataDocum
 		return NULL;
 	}
 
-	return GDATA_DOCUMENTS_FEED (gdata_service_query (GDATA_SERVICE (self), "http://docs.google.com/feeds/documents/private/full";, GDATA_QUERY (query),
-				     GDATA_TYPE_DOCUMENTS_ENTRY, cancellable, progress_callback, progress_user_data, error));
+	/* If we want to query for documents contained in a folder, the URI is different */
+	if (query != NULL && gdata_documents_query_get_folder_id (query) != NULL) {
+		return GDATA_DOCUMENTS_FEED (gdata_service_query (GDATA_SERVICE (self), "http://docs.google.com/feeds/folders/private/full";,
+								  GDATA_QUERY (query), GDATA_TYPE_DOCUMENTS_ENTRY, cancellable, progress_callback,
+								  progress_user_data, error));
+	}
+
+	return GDATA_DOCUMENTS_FEED (gdata_service_query (GDATA_SERVICE (self), "http://docs.google.com/feeds/documents/private/full";,
+							  GDATA_QUERY (query), GDATA_TYPE_DOCUMENTS_ENTRY, cancellable, progress_callback,
+							  progress_user_data, error));
 }
 
 /**
@@ -656,7 +664,6 @@ gdata_documents_service_remove_document_from_folder (GDataDocumentsService *self
 						     GCancellable *cancellable, GError **error)
 {
 	GDataServiceClass *klass;
-	const gchar *document_id, *folder_id;
 	SoupMessage *message;
 	guint status;
 	GDataLink *link;



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