[empathy] protocol-chooser: use TpProtocol



commit 899be9904bd53eb37bee357f22ecdb434f1e28b0
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Tue Jun 5 15:33:46 2012 +0200

    protocol-chooser: use TpProtocol
    
    https://bugzilla.gnome.org/show_bug.cgi?id=677465

 libempathy-gtk/empathy-protocol-chooser.c |   19 ++++++++++---------
 libempathy-gtk/empathy-protocol-chooser.h |    4 ++--
 2 files changed, 12 insertions(+), 11 deletions(-)
---
diff --git a/libempathy-gtk/empathy-protocol-chooser.c b/libempathy-gtk/empathy-protocol-chooser.c
index 5e26112..1178008 100644
--- a/libempathy-gtk/empathy-protocol-chooser.c
+++ b/libempathy-gtk/empathy-protocol-chooser.c
@@ -434,10 +434,9 @@ protocol_chooser_filter_visible_func (GtkTreeModel *model,
 
   if (cm != NULL && protocol_name != NULL)
     {
-      TpConnectionManagerProtocol *protocol;
+      TpProtocol *protocol;
 
-      protocol = (TpConnectionManagerProtocol *)
-        tp_connection_manager_get_protocol (cm, protocol_name);
+      protocol = tp_connection_manager_get_protocol_object (cm, protocol_name);
 
       if (protocol != NULL)
         {
@@ -467,7 +466,7 @@ protocol_chooser_filter_visible_func (GtkTreeModel *model,
 TpConnectionManager *
 empathy_protocol_chooser_dup_selected (
     EmpathyProtocolChooser *protocol_chooser,
-    TpConnectionManagerProtocol **protocol,
+    TpProtocol **protocol,
     gchar **service)
 {
   GtkTreeIter iter;
@@ -495,8 +494,8 @@ empathy_protocol_chooser_dup_selected (
               COL_PROTOCOL_NAME, &protocol_name,
               -1);
 
-          *protocol = (TpConnectionManagerProtocol *)
-            tp_connection_manager_get_protocol (cm, protocol_name);
+          *protocol = tp_connection_manager_get_protocol_object (cm,
+              protocol_name);
 
           g_free (protocol_name);
 
@@ -569,7 +568,7 @@ empathy_protocol_chooser_create_account_settings (EmpathyProtocolChooser *self)
   gchar *str;
   const gchar *display_name;
   TpConnectionManager *cm;
-  TpConnectionManagerProtocol *proto;
+  TpProtocol *proto;
   gchar *service = NULL;
 
   cm = empathy_protocol_chooser_dup_selected (self, &proto, &service);
@@ -579,14 +578,16 @@ empathy_protocol_chooser_create_account_settings (EmpathyProtocolChooser *self)
   if (service != NULL)
     display_name = empathy_service_name_to_display_name (service);
   else
-    display_name = empathy_protocol_name_to_display_name (proto->name);
+    display_name = empathy_protocol_name_to_display_name (
+        tp_protocol_get_name (proto));
 
   /* Create account */
   /* To translator: %s is the name of the protocol, such as "Google Talk" or
    * "Yahoo!"
    */
   str = g_strdup_printf (_("New %s account"), display_name);
-  settings = empathy_account_settings_new (cm->name, proto->name, service, str);
+  settings = empathy_account_settings_new (cm->name,
+      tp_protocol_get_name (proto), service, str);
 
   g_free (str);
 
diff --git a/libempathy-gtk/empathy-protocol-chooser.h b/libempathy-gtk/empathy-protocol-chooser.h
index f3c5776..5aa0a4c 100644
--- a/libempathy-gtk/empathy-protocol-chooser.h
+++ b/libempathy-gtk/empathy-protocol-chooser.h
@@ -61,7 +61,7 @@ struct _EmpathyProtocolChooserClass
 };
 
 typedef gboolean (*EmpathyProtocolChooserFilterFunc) (TpConnectionManager *cm,
-    TpConnectionManagerProtocol *protocol,
+    TpProtocol *protocol,
     const gchar *service,
     gpointer user_data);
 
@@ -69,7 +69,7 @@ GType empathy_protocol_chooser_get_type (void) G_GNUC_CONST;
 GtkWidget * empathy_protocol_chooser_new (void);
 TpConnectionManager *empathy_protocol_chooser_dup_selected (
     EmpathyProtocolChooser *protocol_chooser,
-    TpConnectionManagerProtocol **protocol,
+    TpProtocol **protocol,
     gchar **service);
 
 void empathy_protocol_chooser_set_visible (



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