aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimo.cecchi@collabora.co.uk>2009-05-04 07:44:24 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-06-01 23:47:37 +0800
commit059082374fc8d1cda07486e5e3eb9546a1739811 (patch)
tree1903e69be204f9df20478c6b6c57134d78d98998 /libempathy
parent74817d7509831f225de813fa82fa8d53c3a44f58 (diff)
downloadgsoc2013-empathy-059082374fc8d1cda07486e5e3eb9546a1739811.tar
gsoc2013-empathy-059082374fc8d1cda07486e5e3eb9546a1739811.tar.gz
gsoc2013-empathy-059082374fc8d1cda07486e5e3eb9546a1739811.tar.bz2
gsoc2013-empathy-059082374fc8d1cda07486e5e3eb9546a1739811.tar.lz
gsoc2013-empathy-059082374fc8d1cda07486e5e3eb9546a1739811.tar.xz
gsoc2013-empathy-059082374fc8d1cda07486e5e3eb9546a1739811.tar.zst
gsoc2013-empathy-059082374fc8d1cda07486e5e3eb9546a1739811.zip
Rework the logic of cancelling transfers
Rework the logic of cancelling transfers so that the GCancellable object is not used from an UI frontend, as that would require to duplicate storage for each EmpathyFTHandler in the manager.
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-ft-handler.c19
-rw-r--r--libempathy/empathy-ft-handler.h4
2 files changed, 18 insertions, 5 deletions
diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c
index 89fc13399..93232b187 100644
--- a/libempathy/empathy-ft-handler.c
+++ b/libempathy/empathy-ft-handler.c
@@ -912,15 +912,14 @@ empathy_ft_handler_new_incoming (EmpathyTpFile *tp_file,
}
void
-empathy_ft_handler_start_transfer (EmpathyFTHandler *handler,
- GCancellable *cancellable)
+empathy_ft_handler_start_transfer (EmpathyFTHandler *handler)
{
EmpathyFTHandlerPriv *priv;
g_return_if_fail (EMPATHY_IS_FT_HANDLER (handler));
priv = GET_PRIV (handler);
- priv->cancellable = g_object_ref (cancellable);
+ priv->cancellable = g_cancellable_new ();
if (priv->tpfile == NULL)
{
@@ -941,6 +940,20 @@ empathy_ft_handler_start_transfer (EmpathyFTHandler *handler,
}
void
+empathy_ft_handler_cancel_transfer (EmpathyFTHandler *handler)
+{
+ EmpathyFTHandlerPriv *priv;
+
+ g_return_if_fail (EMPATHY_IS_FT_HANDLER (handler));
+
+ priv = GET_PRIV (handler);
+
+ g_return_if_fail (priv->tpfile != NULL);
+
+ empathy_tp_file_cancel (priv->tpfile);
+}
+
+void
empathy_ft_handler_incoming_set_destination (EmpathyFTHandler *handler,
GFile *destination)
{
diff --git a/libempathy/empathy-ft-handler.h b/libempathy/empathy-ft-handler.h
index 221f4e5b5..085abab52 100644
--- a/libempathy/empathy-ft-handler.h
+++ b/libempathy/empathy-ft-handler.h
@@ -69,8 +69,8 @@ void empathy_ft_handler_new_incoming (EmpathyTpFile *tp_file,
void empathy_ft_handler_incoming_set_destination (EmpathyFTHandler *handler,
GFile *destination);
-void empathy_ft_handler_start_transfer (EmpathyFTHandler *handler,
- GCancellable *cancellable);
+void empathy_ft_handler_start_transfer (EmpathyFTHandler *handler);
+void empathy_ft_handler_cancel_transfer (EmpathyFTHandler *handler);
/* properties of the transfer */
const char * empathy_ft_handler_get_filename (EmpathyFTHandler *handler);