aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-09 20:02:04 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-04-12 17:20:51 +0800
commit5531c75fbba792d0b6af2ba8e72fdced6e67ca74 (patch)
tree4a5ceb769f8b86e126fd3731e4fd34e1c6f8a630
parent0fd156b0466bf42db93a58b1426386c84ad7e43b (diff)
downloadgsoc2013-empathy-5531c75fbba792d0b6af2ba8e72fdced6e67ca74.tar
gsoc2013-empathy-5531c75fbba792d0b6af2ba8e72fdced6e67ca74.tar.gz
gsoc2013-empathy-5531c75fbba792d0b6af2ba8e72fdced6e67ca74.tar.bz2
gsoc2013-empathy-5531c75fbba792d0b6af2ba8e72fdced6e67ca74.tar.lz
gsoc2013-empathy-5531c75fbba792d0b6af2ba8e72fdced6e67ca74.tar.xz
gsoc2013-empathy-5531c75fbba792d0b6af2ba8e72fdced6e67ca74.tar.zst
gsoc2013-empathy-5531c75fbba792d0b6af2ba8e72fdced6e67ca74.zip
change empathy_avatar_chooser_set_connection to empathy_avatar_chooser_set_account
This is a first step in having a more account centric Empathy. This will be used once we'll have Protocol objects to set avatar on offline accounts.
-rw-r--r--libempathy-gtk/empathy-avatar-chooser.c8
-rw-r--r--libempathy-gtk/empathy-avatar-chooser.h4
-rw-r--r--libempathy-gtk/empathy-contact-widget.c10
3 files changed, 14 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-avatar-chooser.c b/libempathy-gtk/empathy-avatar-chooser.c
index 1c5ff7b5e..bd878608e 100644
--- a/libempathy-gtk/empathy-avatar-chooser.c
+++ b/libempathy-gtk/empathy-avatar-chooser.c
@@ -1073,9 +1073,11 @@ empathy_avatar_chooser_get_image_data (EmpathyAvatarChooser *chooser,
}
void
-empathy_avatar_chooser_set_connection (EmpathyAvatarChooser *self,
- TpConnection *connection)
+empathy_avatar_chooser_set_account (EmpathyAvatarChooser *self,
+ TpAccount *account)
{
- avatar_chooser_set_connection (self, connection);
+ g_return_if_fail (account != NULL);
+
+ avatar_chooser_set_connection (self, tp_account_get_connection (account));
g_object_notify (G_OBJECT (self), "connection");
}
diff --git a/libempathy-gtk/empathy-avatar-chooser.h b/libempathy-gtk/empathy-avatar-chooser.h
index 84773574e..6ca583163 100644
--- a/libempathy-gtk/empathy-avatar-chooser.h
+++ b/libempathy-gtk/empathy-avatar-chooser.h
@@ -59,7 +59,7 @@ void empathy_avatar_chooser_get_image_data (EmpathyAvatarChooser *chooser,
gsize *data_size,
const gchar **mime_type);
-void empathy_avatar_chooser_set_connection (EmpathyAvatarChooser *self,
- TpConnection *connection);
+void empathy_avatar_chooser_set_account (EmpathyAvatarChooser *self,
+ TpAccount *account);
#endif /* __EMPATHY_AVATAR_CHOOSER_H__ */
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index b7f4a2696..062bcebf4 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -969,10 +969,14 @@ static void
update_avatar_chooser_account_cb (EmpathyAccountChooser *account_chooser,
EmpathyAvatarChooser *avatar_chooser)
{
- TpConnection *connection;
+ TpAccount *account;
+
+ account = empathy_account_chooser_dup_account (account_chooser);
+ if (account == NULL)
+ return;
- connection = empathy_account_chooser_get_connection (account_chooser);
- empathy_avatar_chooser_set_connection (avatar_chooser, connection);
+ empathy_avatar_chooser_set_account (avatar_chooser, account);
+ g_object_unref (account);
}
static void