[libgdata] documents: Don't use a deprecated function in GDataDocumentsSpreadsheet
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgdata] documents: Don't use a deprecated function in GDataDocumentsSpreadsheet
- Date: Tue, 20 Dec 2011 23:35:29 +0000 (UTC)
commit 488106059bd78c600313921c03927b711066725c
Author: Philip Withnall <philip tecnocode co uk>
Date: Tue Dec 20 21:55:31 2011 +0000
documents: Don't use a deprecated function in GDataDocumentsSpreadsheet
Use resource IDs instead of document IDs.
.../documents/gdata-documents-spreadsheet.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/gdata/services/documents/gdata-documents-spreadsheet.c b/gdata/services/documents/gdata-documents-spreadsheet.c
index 9f97c4b..84141e5 100644
--- a/gdata/services/documents/gdata-documents-spreadsheet.c
+++ b/gdata/services/documents/gdata-documents-spreadsheet.c
@@ -150,14 +150,19 @@ gdata_documents_spreadsheet_new (const gchar *id)
gchar *
gdata_documents_spreadsheet_get_download_uri (GDataDocumentsSpreadsheet *self, const gchar *export_format, gint gid)
{
- const gchar *document_id;
+ const gchar *resource_id, *document_id;
g_return_val_if_fail (GDATA_IS_DOCUMENTS_SPREADSHEET (self), NULL);
g_return_val_if_fail (export_format != NULL && *export_format != '\0', NULL);
g_return_val_if_fail (gid >= -1, NULL);
- document_id = gdata_documents_entry_get_document_id (GDATA_DOCUMENTS_ENTRY (self));
+ /* Extract the document ID from the resource ID. */
+ resource_id = gdata_documents_entry_get_resource_id (GDATA_DOCUMENTS_ENTRY (self));
+ g_assert (resource_id != NULL);
+
+ document_id = g_utf8_strchr (resource_id, -1, ':');
g_assert (document_id != NULL);
+ document_id++; /* skip over the colon */
if (gid != -1) {
return _gdata_service_build_uri ("http://spreadsheets.google.com/feeds/download/spreadsheets/Export?key=%s&exportFormat=%s&gid=%d",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]