[empathy] Add empathy_account_chooser_get_connection()



commit eef992ef2c1010aa31585629aa6990eda76b3f3d
Author: Xavier Claessens <xclaesse gmail com>
Date:   Sun Feb 15 23:36:51 2009 +0100

    Add empathy_account_chooser_get_connection()
---
 libempathy-gtk/empathy-account-chooser.c |   18 ++++++++++++++++++
 libempathy-gtk/empathy-account-chooser.h |    1 +
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/libempathy-gtk/empathy-account-chooser.c b/libempathy-gtk/empathy-account-chooser.c
index 8c402c0..ea3d6e5 100644
--- a/libempathy-gtk/empathy-account-chooser.c
+++ b/libempathy-gtk/empathy-account-chooser.c
@@ -241,6 +241,24 @@ empathy_account_chooser_get_account (EmpathyAccountChooser *chooser)
 	return account;
 }
 
+TpConnection *
+empathy_account_chooser_get_connection (EmpathyAccountChooser *chooser)
+{
+	EmpathyAccountChooserPriv *priv;
+	McAccount                 *account;
+	TpConnection              *connection;
+
+	g_return_val_if_fail (EMPATHY_IS_ACCOUNT_CHOOSER (chooser), NULL);
+
+	priv = GET_PRIV (chooser);
+
+	account = empathy_account_chooser_get_account (chooser);
+	connection = empathy_account_manager_get_connection (priv->manager, account);
+	g_object_unref (account);
+
+	return connection;
+}
+
 gboolean
 empathy_account_chooser_set_account (EmpathyAccountChooser *chooser,
 				     McAccount             *account)
diff --git a/libempathy-gtk/empathy-account-chooser.h b/libempathy-gtk/empathy-account-chooser.h
index c15923b..4dfdc63 100644
--- a/libempathy-gtk/empathy-account-chooser.h
+++ b/libempathy-gtk/empathy-account-chooser.h
@@ -57,6 +57,7 @@ struct _EmpathyAccountChooserClass {
 GType          empathy_account_chooser_get_type           (void) G_GNUC_CONST;
 GtkWidget *    empathy_account_chooser_new                (void);
 McAccount *    empathy_account_chooser_get_account        (EmpathyAccountChooser *chooser);
+TpConnection * empathy_account_chooser_get_connection     (EmpathyAccountChooser *chooser);
 gboolean       empathy_account_chooser_set_account        (EmpathyAccountChooser *chooser,
 							   McAccount            *account);
 gboolean       empathy_account_chooser_get_has_all_option (EmpathyAccountChooser *chooser);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]