]> git.0d.be Git - empathy.git/commitdiff
main-window: use tp_connection_get_account()
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 19 Aug 2011 10:12:22 +0000 (12:12 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 19 Aug 2011 10:51:43 +0000 (12:51 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=656866

src/empathy-main-window.c

index e3588c26c1ca0cb510cb6ed37f2c931141a993da..167e338d690a7b936aaaf80f405b77169fc3d5fb 100644 (file)
@@ -901,7 +901,7 @@ static void
 main_window_balance_update_balance (GtkAction   *action,
                                    TpConnection *conn)
 {
-       TpAccount *account = g_object_get_data (G_OBJECT (action), "account");
+       TpAccount *account = tp_connection_get_account (conn);
        GtkWidget *label;
        int amount = 0;
        guint scale = G_MAXINT32;
@@ -977,7 +977,6 @@ main_window_setup_balance_create_action (EmpathyMainWindow *window,
        g_object_bind_property (account, "icon-name", action, "icon-name",
                G_BINDING_SYNC_CREATE);
 
-       g_object_set_data (G_OBJECT (action), "account", account);
        g_signal_connect (action, "activate",
                G_CALLBACK (main_window_balance_activate_cb), window);
 
@@ -1016,15 +1015,12 @@ main_window_setup_balance_create_action (EmpathyMainWindow *window,
 
 static GtkWidget *
 main_window_setup_balance_create_widget (EmpathyMainWindow *window,
-                                        GtkAction         *action)
+                                        GtkAction         *action,
+                                        TpAccount *account)
 {
        EmpathyMainWindowPriv *priv = GET_PRIV (window);
-       TpAccount *account;
        GtkWidget *hbox, *image, *label, *button;
 
-       account = g_object_get_data (G_OBJECT (action), "account");
-       g_return_val_if_fail (TP_IS_ACCOUNT (account), NULL);
-
        hbox = gtk_hbox_new (FALSE, 6);
 
        /* protocol icon */
@@ -1074,10 +1070,6 @@ main_window_setup_balance (EmpathyMainWindow *window,
        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;
 
@@ -1093,7 +1085,7 @@ main_window_setup_balance (EmpathyMainWindow *window,
        gtk_action_set_visible (priv->view_balance_show_in_roster, TRUE);
 
        /* create the display widget */
-       main_window_setup_balance_create_widget (window, action);
+       main_window_setup_balance_create_widget (window, action, account);
 
        /* check the current balance and monitor for any changes */
        uri = tp_connection_get_balance_uri (conn);