[gedit] Also close the input stream sync for the saver.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gedit] Also close the input stream sync for the saver.
- Date: Mon, 8 Feb 2010 22:52:25 +0000 (UTC)
commit a1b97453d214ccf5019ab475b991d361c81a9c55
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Feb 8 23:52:06 2010 +0100
Also close the input stream sync for the saver.
gedit/gedit-gio-document-saver.c | 33 ++++++---------------------------
1 files changed, 6 insertions(+), 27 deletions(-)
---
diff --git a/gedit/gedit-gio-document-saver.c b/gedit/gedit-gio-document-saver.c
index 0cff7cf..8ed75b8 100644
--- a/gedit/gedit-gio-document-saver.c
+++ b/gedit/gedit-gio-document-saver.c
@@ -263,25 +263,16 @@ close_async_ready_get_info_cb (GOutputStream *stream,
}
static void
-close_input_stream_ready_cb (GInputStream *stream,
- GAsyncResult *res,
- AsyncData *async)
+write_complete (AsyncData *async)
{
GError *error = NULL;
-
- /* check cancelled state manually */
- if (g_cancellable_is_cancelled (async->cancellable))
- {
- async_data_free (async);
- return;
- }
-
- gedit_debug_message (DEBUG_SAVER, "Finished closing input stream");
-
- if (!g_input_stream_close_finish (stream, res, &error))
+
+ /* first we close the input stream */
+ gedit_debug_message (DEBUG_SAVER, "Close input stream");
+ if (!g_input_stream_close (async->saver->priv->input,
+ async->cancellable, &error))
{
gedit_debug_message (DEBUG_SAVER, "Closing input stream error: %s", error->message);
-
async_failed (async, error);
return;
}
@@ -295,18 +286,6 @@ close_input_stream_ready_cb (GInputStream *stream,
async);
}
-static void
-write_complete (AsyncData *async)
-{
- /* first we close the input stream */
- gedit_debug_message (DEBUG_SAVER, "Close input stream");
- g_input_stream_close_async (async->saver->priv->input,
- G_PRIORITY_HIGH,
- async->cancellable,
- (GAsyncReadyCallback)close_input_stream_ready_cb,
- async);
-}
-
/* prototype, because they call each other... isn't C lovely */
static void read_file_chunk (AsyncData *async);
static void write_file_chunk (AsyncData *async);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]