diff options
author | Xavier Claessens <xclaesse@src.gnome.org> | 2008-11-22 00:22:58 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2008-11-22 00:22:58 +0800 |
commit | 0ec0fd88d836a9c72df629d410ed7eeb5a60d540 (patch) | |
tree | 423283750a05d8ea0821083cb40170e5ea38d66c | |
parent | cf97caca295b0484e866a8b5e328a9a0c649e6c8 (diff) | |
download | gsoc2013-empathy-0ec0fd88d836a9c72df629d410ed7eeb5a60d540.tar gsoc2013-empathy-0ec0fd88d836a9c72df629d410ed7eeb5a60d540.tar.gz gsoc2013-empathy-0ec0fd88d836a9c72df629d410ed7eeb5a60d540.tar.bz2 gsoc2013-empathy-0ec0fd88d836a9c72df629d410ed7eeb5a60d540.tar.lz gsoc2013-empathy-0ec0fd88d836a9c72df629d410ed7eeb5a60d540.tar.xz gsoc2013-empathy-0ec0fd88d836a9c72df629d410ed7eeb5a60d540.tar.zst gsoc2013-empathy-0ec0fd88d836a9c72df629d410ed7eeb5a60d540.zip |
Fix coding style and cleanup
svn path=/trunk/; revision=1880
-rw-r--r-- | src/empathy.c | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/empathy.c b/src/empathy.c index 92be3239e..869d14880 100644 --- a/src/empathy.c +++ b/src/empathy.c @@ -61,33 +61,24 @@ static BaconMessageConnection *connection = NULL; static void -file_channel_add_to_file_manager (TpChannel *channel) -{ - EmpathyTpFile *tp_file; - EmpathyFTManager *ft_manager; - - ft_manager = empathy_ft_manager_get_default (); - tp_file = empathy_tp_file_new (channel); - empathy_ft_manager_add_tp_file (ft_manager, tp_file); - - g_object_unref (channel); -} - -static void file_channel_get_state_cb (TpProxy *proxy, const GValue *state_value, const GError *error, gpointer user_data, GObject *weak_object) { + EmpathyTpFile *tp_file; + EmpathyFTManager *ft_manager; EmpFileTransferState state; - state = g_value_get_uint (state_value); - if (state == EMP_FILE_TRANSFER_STATE_PENDING) - { - file_channel_add_to_file_manager (TP_CHANNEL (proxy)); + state = g_value_get_uint (state_value); + if (state != EMP_FILE_TRANSFER_STATE_PENDING) { return; } + + ft_manager = empathy_ft_manager_get_default (); + tp_file = empathy_tp_file_new (TP_CHANNEL (proxy)); + empathy_ft_manager_add_tp_file (ft_manager, tp_file); } static void @@ -136,7 +127,7 @@ dispatch_channel_cb (EmpathyDispatcher *dispatcher, empathy_call_window_new (channel); } else if (!tp_strdiff (channel_type, EMP_IFACE_CHANNEL_TYPE_FILE_TRANSFER)) { - tp_cli_dbus_properties_call_get (g_object_ref (channel), -1, + tp_cli_dbus_properties_call_get (channel, -1, EMP_IFACE_CHANNEL_TYPE_FILE_TRANSFER, "State", file_channel_get_state_cb, NULL, NULL, NULL); |