[libgdata] [documents] Fix gcc printf format warning message



commit d40afb3d5c2df1c41bcbce11773a7be90bbad781
Author: Philip Withnall <philip tecnocode co uk>
Date:   Mon Mar 22 16:50:33 2010 +0000

    [documents] Fix gcc printf format warning message

 gdata/services/documents/gdata-documents-service.c |   26 +++++++++++--------
 1 files changed, 15 insertions(+), 11 deletions(-)
---
diff --git a/gdata/services/documents/gdata-documents-service.c b/gdata/services/documents/gdata-documents-service.c
index 657a21e..cb12c7d 100644
--- a/gdata/services/documents/gdata-documents-service.c
+++ b/gdata/services/documents/gdata-documents-service.c
@@ -667,7 +667,7 @@ GDataDocumentsEntry *
 gdata_documents_service_remove_document_from_folder (GDataDocumentsService *self, GDataDocumentsEntry *document, GDataDocumentsFolder *folder,
 						     GCancellable *cancellable, GError **error)
 {
-	const gchar *folder_id, *document_id, *uri_template;
+	const gchar *folder_id, *document_id;
 	GDataServiceClass *klass;
 	SoupMessage *message;
 	guint status;
@@ -690,18 +690,22 @@ gdata_documents_service_remove_document_from_folder (GDataDocumentsService *self
 	g_assert (folder_id != NULL);
 	g_assert (document_id != NULL);
 
-	if (GDATA_IS_DOCUMENTS_PRESENTATION (document))
-		uri_template = "%s://docs.google.com/feeds/folders/private/full/folder%%3A%s/presentation%%3A%s";
-	else if (GDATA_IS_DOCUMENTS_SPREADSHEET (document))
-		uri_template = "%s://docs.google.com/feeds/folders/private/full/folder%%3A%s/spreadsheet%%3A%s";
-	else if (GDATA_IS_DOCUMENTS_TEXT (document))
-		uri_template = "%s://docs.google.com/feeds/folders/private/full/folder%%3A%s/document%%3A%s";
-	else if (GDATA_IS_DOCUMENTS_FOLDER (document))
-		uri_template = "%s://docs.google.com/feeds/folders/private/full/folder%%3A%s/folder%%3A%s";
-	else
+	if (GDATA_IS_DOCUMENTS_PRESENTATION (document)) {
+		uri = g_strdup_printf ("%s://docs.google.com/feeds/folders/private/full/folder%%3A%s/presentation%%3A%s",
+		                       _gdata_service_get_scheme (), folder_id, document_id);
+	} else if (GDATA_IS_DOCUMENTS_SPREADSHEET (document)) {
+		uri = g_strdup_printf ("%s://docs.google.com/feeds/folders/private/full/folder%%3A%s/spreadsheet%%3A%s",
+		                       _gdata_service_get_scheme (), folder_id, document_id);
+	} else if (GDATA_IS_DOCUMENTS_TEXT (document)) {
+		uri = g_strdup_printf ("%s://docs.google.com/feeds/folders/private/full/folder%%3A%s/document%%3A%s",
+		                       _gdata_service_get_scheme (), folder_id, document_id);
+	} else if (GDATA_IS_DOCUMENTS_FOLDER (document)) {
+		uri = g_strdup_printf ("%s://docs.google.com/feeds/folders/private/full/folder%%3A%s/folder%%3A%s",
+		                       _gdata_service_get_scheme (), folder_id, document_id);
+	} else {
 		g_assert_not_reached ();
+	}
 
-	uri = g_strdup_printf (uri_template, _gdata_service_get_scheme (), folder_id, document_id);
 	message = soup_message_new (SOUP_METHOD_DELETE, uri);
 	g_free (uri);
 



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