[gnome-documents/wip/skydrive] lib: use an async method to create the SkyDrivedownload stream
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/wip/skydrive] lib: use an async method to create the SkyDrivedownload stream
- Date: Fri, 1 Jun 2012 19:43:12 +0000 (UTC)
commit 666586dcaad6dc00fef9fcf1482f97dcab4a4627
Author: Debarshi Ray <debarshir gnome org>
Date: Fri Jun 1 21:35:27 2012 +0200
lib: use an async method to create the SkyDrivedownload stream
Fixes: https://bugzilla.gnome.org/666535
src/lib/gd-pdf-loader.c | 24 ++++++++++++++++++------
1 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/src/lib/gd-pdf-loader.c b/src/lib/gd-pdf-loader.c
index 26c08ce..d9afed8 100644
--- a/src/lib/gd-pdf-loader.c
+++ b/src/lib/gd-pdf-loader.c
@@ -380,16 +380,15 @@ pdf_load_job_gdata_refresh_cache (PdfLoadJob *job)
}
static void
-pdf_load_job_zpj_refresh_cache (PdfLoadJob *job)
+download_stream_ready (GObject *source,
+ GAsyncResult *res,
+ gpointer user_data)
{
- GInputStream *stream;
GError *error = NULL;
GFile *pdf_file;
+ PdfLoadJob *job = (PdfLoadJob *) user_data;
- job->stream = zpj_skydrive_download_file_to_stream (job->zpj_service,
- ZPJ_SKYDRIVE_FILE (job->zpj_entry),
- job->cancellable, &error);
-
+ job->stream = zpj_skydrive_download_file_to_stream_finish (ZPJ_SKYDRIVE (source), res, &error);
if (error != NULL) {
pdf_load_job_complete_error (job, error);
return;
@@ -407,6 +406,19 @@ pdf_load_job_zpj_refresh_cache (PdfLoadJob *job)
}
static void
+pdf_load_job_zpj_refresh_cache (PdfLoadJob *job)
+{
+ GInputStream *stream;
+ GError *error = NULL;
+
+ zpj_skydrive_download_file_to_stream_async (job->zpj_service,
+ ZPJ_SKYDRIVE_FILE (job->zpj_entry),
+ job->cancellable,
+ download_stream_ready,
+ job);
+}
+
+static void
gdata_cache_query_info_ready_cb (GObject *source,
GAsyncResult *res,
gpointer user_data)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]