diff options
author | Cosimo Cecchi <cosimo.cecchi@collabora.co.uk> | 2009-05-05 21:01:34 +0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2009-06-01 23:47:39 +0800 |
commit | b026e9345b2249d2d5d1217ea79315ffa43151cc (patch) | |
tree | 47002dc9029d5bbf98b822d11e899128f6175356 | |
parent | 4d6781912473aa6b08f78e40857124e1182b4655 (diff) | |
download | gsoc2013-empathy-b026e9345b2249d2d5d1217ea79315ffa43151cc.tar gsoc2013-empathy-b026e9345b2249d2d5d1217ea79315ffa43151cc.tar.gz gsoc2013-empathy-b026e9345b2249d2d5d1217ea79315ffa43151cc.tar.bz2 gsoc2013-empathy-b026e9345b2249d2d5d1217ea79315ffa43151cc.tar.lz gsoc2013-empathy-b026e9345b2249d2d5d1217ea79315ffa43151cc.tar.xz gsoc2013-empathy-b026e9345b2249d2d5d1217ea79315ffa43151cc.tar.zst gsoc2013-empathy-b026e9345b2249d2d5d1217ea79315ffa43151cc.zip |
Don't set the status to cancelled when closing
If we are only closing a channel, don't set the EmpathyTpFile status to
cancelled.
-rw-r--r-- | libempathy/empathy-tp-file.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c index c36706eca..620d197d7 100644 --- a/libempathy/empathy-tp-file.c +++ b/libempathy/empathy-tp-file.c @@ -186,6 +186,8 @@ splice_stream_ready_cb (GObject *source, tp_file = user_data; + DEBUG ("Splice stream ready cb"); + g_output_stream_splice_finish (G_OUTPUT_STREAM (source), res, &error); if (error != NULL) @@ -457,6 +459,25 @@ file_replace_async_cb (GObject *source, ft_operation_provide_or_accept_file_cb, NULL, NULL, G_OBJECT (tp_file)); } +static void +close_channel_internal (EmpathyTpFile *tp_file, + gboolean cancel) +{ + EmpathyTpFilePriv *priv; + + g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file)); + + priv = GET_PRIV (tp_file); + + DEBUG ("Closing channel.."); + tp_cli_channel_call_close (priv->channel, -1, + NULL, NULL, NULL, NULL); + + if (priv->cancellable != NULL && + !g_cancellable_is_cancelled (priv->cancellable) && cancel) + g_cancellable_cancel (priv->cancellable); +} + /* GObject methods */ static void @@ -725,19 +746,7 @@ empathy_tp_file_is_incoming (EmpathyTpFile *tp_file) void empathy_tp_file_cancel (EmpathyTpFile *tp_file) { - EmpathyTpFilePriv *priv; - - g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file)); - - priv = GET_PRIV (tp_file); - - DEBUG ("Closing channel.."); - tp_cli_channel_call_close (priv->channel, -1, - NULL, NULL, NULL, NULL); - - if (priv->cancellable != NULL && - !g_cancellable_is_cancelled (priv->cancellable)) - g_cancellable_cancel (priv->cancellable); + close_channel_internal (tp_file, TRUE); } /** @@ -755,7 +764,5 @@ empathy_tp_file_cancel (EmpathyTpFile *tp_file) gboolean empathy_tp_file_is_ready (EmpathyTpFile *tp_file) { - g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file), FALSE); - - return tp_file->priv->ready; + close_channel_internal (tp_file, FALSE); } |