diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-08-18 23:29:56 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-08-19 15:26:35 +0800 |
commit | fb56e32dcdc0ad78c59c3d34d500a24c954a6ab0 (patch) | |
tree | d8f732d95aa62f85f162989797f94589f4e4ca00 /src/empathy-main-window.c | |
parent | 3f96f6d69d75bef18d372c26df40ab3bbd3628fe (diff) | |
download | gsoc2013-empathy-fb56e32dcdc0ad78c59c3d34d500a24c954a6ab0.tar gsoc2013-empathy-fb56e32dcdc0ad78c59c3d34d500a24c954a6ab0.tar.gz gsoc2013-empathy-fb56e32dcdc0ad78c59c3d34d500a24c954a6ab0.tar.bz2 gsoc2013-empathy-fb56e32dcdc0ad78c59c3d34d500a24c954a6ab0.tar.lz gsoc2013-empathy-fb56e32dcdc0ad78c59c3d34d500a24c954a6ab0.tar.xz gsoc2013-empathy-fb56e32dcdc0ad78c59c3d34d500a24c954a6ab0.tar.zst gsoc2013-empathy-fb56e32dcdc0ad78c59c3d34d500a24c954a6ab0.zip |
rely on the factory to prepare TP_CONNECTION_FEATURE_BALANCE
https://bugzilla.gnome.org/show_bug.cgi?id=656831
Diffstat (limited to 'src/empathy-main-window.c')
-rw-r--r-- | src/empathy-main-window.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c index 3ecb939a4..e3588c26c 100644 --- a/src/empathy-main-window.c +++ b/src/empathy-main-window.c @@ -1063,24 +1063,20 @@ main_window_setup_balance_create_widget (EmpathyMainWindow *window, } static void -main_window_setup_balance_conn_ready (GObject *source, - GAsyncResult *result, - gpointer user_data) +main_window_setup_balance (EmpathyMainWindow *window, + TpAccount *account) { - EmpathyMainWindow *window = user_data; EmpathyMainWindowPriv *priv = GET_PRIV (window); - TpConnection *conn = TP_CONNECTION (source); - TpAccount *account = g_object_get_data (source, "account"); + TpConnection *conn = tp_account_get_connection (account); GtkAction *action; - GError *error = NULL; const gchar *uri; - if (!tp_proxy_prepare_finish (conn, result, &error)) { - DEBUG ("Failed to prepare connection: %s", error->message); - - g_error_free (error); + if (conn == NULL) return; - } + + /* need to prepare the connection: + * store the account on the connection */ + g_object_set_data (G_OBJECT (conn), "account", account); if (!tp_proxy_is_prepared (conn, TP_CONNECTION_FEATURE_BALANCE)) return; @@ -1110,23 +1106,7 @@ main_window_setup_balance_conn_ready (GObject *source, g_signal_connect (conn, "balance-changed", G_CALLBACK (main_window_balance_changed_cb), action); -} - -static void -main_window_setup_balance (EmpathyMainWindow *window, - TpAccount *account) -{ - TpConnection *conn = tp_account_get_connection (account); - GQuark features[] = { TP_CONNECTION_FEATURE_BALANCE, 0 }; - if (conn == NULL) - return; - - /* need to prepare the connection: - * store the account on the connection */ - g_object_set_data (G_OBJECT (conn), "account", account); - tp_proxy_prepare_async (conn, features, - main_window_setup_balance_conn_ready, window); } static void |