aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-file.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-11-22 00:25:11 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-11-22 00:25:11 +0800
commit6bc969461080973c6878f0eb1973fd626f8a9663 (patch)
treeeb19a2deef68ff22d8e0e074fa9888fe09937aa2 /libempathy/empathy-tp-file.c
parent6c7b2aa5c1581f9e40cfdc38f67fe7f479a745b5 (diff)
downloadgsoc2013-empathy-6bc969461080973c6878f0eb1973fd626f8a9663.tar
gsoc2013-empathy-6bc969461080973c6878f0eb1973fd626f8a9663.tar.gz
gsoc2013-empathy-6bc969461080973c6878f0eb1973fd626f8a9663.tar.bz2
gsoc2013-empathy-6bc969461080973c6878f0eb1973fd626f8a9663.tar.lz
gsoc2013-empathy-6bc969461080973c6878f0eb1973fd626f8a9663.tar.xz
gsoc2013-empathy-6bc969461080973c6878f0eb1973fd626f8a9663.tar.zst
gsoc2013-empathy-6bc969461080973c6878f0eb1973fd626f8a9663.zip
Remove empathy_tp_file_keep_alive hack and connect to "notify::state" in file_channel_create_cb() to unref the object when the FT is done.
svn path=/trunk/; revision=1913
Diffstat (limited to 'libempathy/empathy-tp-file.c')
-rw-r--r--libempathy/empathy-tp-file.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/libempathy/empathy-tp-file.c b/libempathy/empathy-tp-file.c
index 9a6602ecc..940db073a 100644
--- a/libempathy/empathy-tp-file.c
+++ b/libempathy/empathy-tp-file.c
@@ -297,7 +297,6 @@ struct _EmpathyTpFilePriv {
time_t start_time;
gchar *unix_socket_path;
GCancellable *cancellable;
- gboolean keep_alive;
};
enum {
@@ -327,18 +326,6 @@ empathy_tp_file_init (EmpathyTpFile *tp_file)
}
static void
-tp_file_check_keep_alive (EmpathyTpFile *tp_file)
-{
- if (tp_file->priv->keep_alive &&
- (tp_file->priv->state == EMP_FILE_TRANSFER_STATE_COMPLETED ||
- tp_file->priv->state == EMP_FILE_TRANSFER_STATE_CANCELLED))
- {
- tp_file->priv->keep_alive = FALSE;
- g_object_unref (tp_file);
- }
-}
-
-static void
tp_file_invalidated_cb (TpProxy *proxy,
guint domain,
gint code,
@@ -356,8 +343,6 @@ tp_file_invalidated_cb (TpProxy *proxy,
EMP_FILE_TRANSFER_STATE_CHANGE_REASON_LOCAL_ERROR;
g_object_notify (G_OBJECT (tp_file), "state");
}
-
- tp_file_check_keep_alive (tp_file);
}
static void
@@ -488,7 +473,6 @@ tp_file_state_changed_cb (TpProxy *proxy,
tp_file->priv->state_change_reason = reason;
g_object_notify (G_OBJECT (tp_file), "state");
- tp_file_check_keep_alive (tp_file);
}
static void
@@ -840,27 +824,6 @@ empathy_tp_file_offer (EmpathyTpFile *tp_file, GFile *gfile, GError **error)
&nothing, tp_file_method_cb, NULL, NULL, G_OBJECT (tp_file));
}
-/**
- * empathy_tp_file_keep_alive:
- * @tp_file: an #EmpathyTpFile
- *
- * Keep @tp_file alive until the file transfer is COMPLETED or CANCELLED, by
- * adding a temporary reference.
- */
-void
-empathy_tp_file_keep_alive (EmpathyTpFile *tp_file)
-{
- g_return_if_fail (EMPATHY_IS_TP_FILE (tp_file));
-
- if (tp_file->priv->keep_alive)
- return;
-
- tp_file->priv->keep_alive = TRUE;
- if (tp_file->priv->state != EMP_FILE_TRANSFER_STATE_COMPLETED &&
- tp_file->priv->state != EMP_FILE_TRANSFER_STATE_CANCELLED)
- g_object_ref (tp_file);
-}
-
EmpathyContact *
empathy_tp_file_get_contact (EmpathyTpFile *tp_file)
{