aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-file.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimo.cecchi@collabora.co.uk>2009-05-04 08:14:43 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-06-01 23:47:38 +0800
commita6b83fc7b0d3a0dbbd2d0266f6b2250221e803bb (patch)
tree40cdc85cac524753ec9a28a5adfd94bd6b733044 /libempathy/empathy-tp-file.c
parent1f239a9cb9595292b71fc0336e5d0055c5b81860 (diff)
downloadgsoc2013-empathy-a6b83fc7b0d3a0dbbd2d0266f6b2250221e803bb.tar
gsoc2013-empathy-a6b83fc7b0d3a0dbbd2d0266f6b2250221e803bb.tar.gz
gsoc2013-empathy-a6b83fc7b0d3a0dbbd2d0266f6b2250221e803bb.tar.bz2
gsoc2013-empathy-a6b83fc7b0d3a0dbbd2d0266f6b2250221e803bb.tar.lz
gsoc2013-empathy-a6b83fc7b0d3a0dbbd2d0266f6b2250221e803bb.tar.xz
gsoc2013-empathy-a6b83fc7b0d3a0dbbd2d0266f6b2250221e803bb.tar.zst
gsoc2013-empathy-a6b83fc7b0d3a0dbbd2d0266f6b2250221e803bb.zip
First implementation of error handling
Implement the callback in EmpathyFTManager. Erase a redundant is_cancelled property in EmpathyFTHandler and rely on the GCancellable, which is shared by EmpathyTpFile and EmpathyFTHandler.
Diffstat (limited to 'libempathy/empathy-tp-file.c')
-rw-r--r--libempathy/empathy-tp-file.c34
1 files changed, 2 insertions, 32 deletions
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c
index 098440a42..88d13f358 100644
--- a/libempathy/empathy-tp-file.c
+++ b/libempathy/empathy-tp-file.c
@@ -737,37 +737,6 @@ empathy_tp_file_is_incoming (EmpathyTpFile *tp_file)
return priv->incoming;
}
-/**
- * empathy_tp_file_get_state:
- * @tp_file: an #EmpathyTpFile
- * @reason: return location for state change reason, or %NULL
- *
- * Gets the current state of @tp_file. If @reason is not %NULL, then
- * it is set to the reason of the last state change.
- *
- * Return value: a #TpFileTransferState
- */
-TpFileTransferState
-empathy_tp_file_get_state (EmpathyTpFile *tp_file,
- TpFileTransferStateChangeReason *reason)
-{
- EmpathyTpFilePriv *priv = GET_PRIV (tp_file);
-
- g_return_val_if_fail (EMPATHY_IS_TP_FILE (tp_file),
- TP_FILE_TRANSFER_STATE_NONE);
-
- if (reason != NULL)
- *reason = priv->state_change_reason;
-
- return priv->state;
-}
-
-/**
- * empathy_tp_file_cancel:
- * @tp_file: an #EmpathyTpFile
- *
- * Cancels the file transfer, @tp_file.
- */
void
empathy_tp_file_cancel (EmpathyTpFile *tp_file)
{
@@ -781,7 +750,8 @@ empathy_tp_file_cancel (EmpathyTpFile *tp_file)
tp_cli_channel_call_close (priv->channel, -1,
NULL, NULL, NULL, NULL);
- if (priv->cancellable != NULL)
+ if (priv->cancellable != NULL &&
+ !g_cancellable_is_cancelled (priv->cancellable))
g_cancellable_cancel (priv->cancellable);
}