aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-08-18 23:29:56 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2011-08-19 15:26:35 +0800
commitfb56e32dcdc0ad78c59c3d34d500a24c954a6ab0 (patch)
treed8f732d95aa62f85f162989797f94589f4e4ca00
parent3f96f6d69d75bef18d372c26df40ab3bbd3628fe (diff)
downloadgsoc2013-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
-rw-r--r--libempathy/empathy-client-factory.c3
-rw-r--r--src/empathy-main-window.c36
2 files changed, 11 insertions, 28 deletions
diff --git a/libempathy/empathy-client-factory.c b/libempathy/empathy-client-factory.c
index 200ea5fe2..d3cc57e03 100644
--- a/libempathy/empathy-client-factory.c
+++ b/libempathy/empathy-client-factory.c
@@ -146,6 +146,9 @@ empathy_client_factory_dup_connection_features (TpSimpleClientFactory *factory,
feature = TP_CONNECTION_FEATURE_CONTACT_INFO;
g_array_append_val (features, feature);
+ feature = TP_CONNECTION_FEATURE_BALANCE;
+ g_array_append_val (features, feature);
+
return features;
}
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