aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-ft-handler.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimo.cecchi@collabora.co.uk>2009-02-18 23:41:12 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-06-01 23:47:34 +0800
commit58d08cef143811d990218551a922451609978610 (patch)
treed90811a64a6135a048d3c90aee13654019089b5b /libempathy/empathy-ft-handler.c
parent1e69ae50fa2a35ac4e54283d40e9d96777ff6e61 (diff)
downloadgsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar.gz
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar.bz2
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar.lz
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar.xz
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.tar.zst
gsoc2013-empathy-58d08cef143811d990218551a922451609978610.zip
Rethink a bit the logic for an incoming transfer.
Now, a client should have to do the following, in order to receive a file transfer: - let the EmpathyFTFactory claim the EmpathyDispatchOperation - the factory will emit "new-incoming-transfer" when the handler is filled with the relevant properties - now you can choose a destination file, and then you should call _set_destination on EmpathyFTFactory passing the handler. - the factory will emit "new-ft-handler" as you're now ready to start the actual transfer.
Diffstat (limited to 'libempathy/empathy-ft-handler.c')
-rw-r--r--libempathy/empathy-ft-handler.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/libempathy/empathy-ft-handler.c b/libempathy/empathy-ft-handler.c
index d1909c15c..0d061b59c 100644
--- a/libempathy/empathy-ft-handler.c
+++ b/libempathy/empathy-ft-handler.c
@@ -855,7 +855,6 @@ empathy_ft_handler_new_outgoing (EmpathyContact *contact,
void
empathy_ft_handler_new_incoming (EmpathyTpFile *tp_file,
- GFile *destination,
EmpathyFTHandlerReadyCallback callback,
gpointer user_data)
{
@@ -864,10 +863,9 @@ empathy_ft_handler_new_incoming (EmpathyTpFile *tp_file,
CallbacksData *data;
g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file));
- g_return_if_fail (G_IS_FILE (destination));
handler = g_object_new (EMPATHY_TYPE_FT_HANDLER,
- "tp-file", tp_file, "gfile", destination, NULL);
+ "tp-file", tp_file, NULL);
g_object_get (tp_file, "channel", &channel, NULL);
@@ -909,3 +907,25 @@ empathy_ft_handler_start_transfer (EmpathyFTHandler *handler,
ft_transfer_operation_callback, handler);
}
}
+
+void
+empathy_ft_handler_incoming_set_destination (EmpathyFTHandler *handler,
+ GFile *destination)
+{
+ g_return_if_fail (EMPATHY_IS_FT_HANDLER (handler));
+ g_return_if_fail (G_IS_FILE (destination));
+
+ g_object_set (handler, "gfile", destination, NULL);
+}
+
+const char *
+empathy_ft_handler_get_filename (EmpathyFTHandler *handler)
+{
+ EmpathyFTHandlerPriv *priv;
+
+ g_return_val_if_fail (EMPATHY_IS_FT_HANDLER (handler), NULL);
+
+ priv = GET_PRIV (handler);
+
+ return priv->filename;
+}