[empathy] Make empathy_protocol_name_to_display_name public



commit 073dc5b0186057f6f30818c3fc50d2070b1743a1
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Tue Aug 25 11:50:26 2009 +0200

    Make empathy_protocol_name_to_display_name public

 libempathy-gtk/empathy-protocol-chooser.c |   31 +----------------------------
 libempathy/empathy-utils.c                |   30 ++++++++++++++++++++++++++++
 libempathy/empathy-utils.h                |    1 +
 3 files changed, 32 insertions(+), 30 deletions(-)
---
diff --git a/libempathy-gtk/empathy-protocol-chooser.c b/libempathy-gtk/empathy-protocol-chooser.c
index c9dbb40..1b29f7d 100644
--- a/libempathy-gtk/empathy-protocol-chooser.c
+++ b/libempathy-gtk/empathy-protocol-chooser.c
@@ -128,35 +128,6 @@ protocol_chooser_sort_func (GtkTreeModel *model,
   return cmp;
 }
 
-static const char *
-protocol_chooser_proto_name_to_display_name (const gchar *proto_name)
-{
-  int i;
-  static struct {
-    const gchar *proto;
-    const gchar *display;
-  } names[] = {
-    { "jabber", "Jabber" },
-    { "msn", "MSN" },
-    { "local-xmpp", N_("People Nearby") },
-    { "irc", "IRC" },
-    { "icq", "ICQ" },
-    { "aim", "AIM" },
-    { "yahoo", "Yahoo!" },
-    { "groupwise", "GroupWise" },
-    { "sip", "SIP" },
-    { NULL, NULL }
-  };
-
-  for (i = 0; names[i].proto != NULL; i++)
-    {
-      if (!tp_strdiff (proto_name, names[i].proto))
-        return names[i].display;
-    }
-
-  return NULL;
-}
-
 static void
 protocol_choosers_add_cm (EmpathyProtocolChooser *chooser,
     TpConnectionManager *cm)
@@ -225,7 +196,7 @@ protocol_choosers_add_cm (EmpathyProtocolChooser *chooser,
           g_strdup (proto->name), g_strdup (cm->name));
 
       icon_name = empathy_protocol_icon_name (proto->name);
-      display_name = protocol_chooser_proto_name_to_display_name (proto->name);
+      display_name = empathy_protocol_name_to_display_name (proto->name);
 
       if (display_name == NULL)
         display_name = proto->name;
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index db35e94..028a24d 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -364,3 +364,33 @@ empathy_type_dbus_ao (void)
 
   return t;
 }
+
+const char *
+empathy_protocol_name_to_display_name (const gchar *proto_name)
+{
+  int i;
+  static struct {
+    const gchar *proto;
+    const gchar *display;
+  } names[] = {
+    { "jabber", "Jabber" },
+    { "msn", "MSN" },
+    { "local-xmpp", N_("People Nearby") },
+    { "irc", "IRC" },
+    { "icq", "ICQ" },
+    { "aim", "AIM" },
+    { "yahoo", "Yahoo!" },
+    { "groupwise", "GroupWise" },
+    { "sip", "SIP" },
+    { NULL, NULL }
+  };
+
+  for (i = 0; names[i].proto != NULL; i++)
+    {
+      if (!tp_strdiff (proto_name, names[i].proto))
+        return names[i].display;
+    }
+
+  return NULL;
+}
+
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index c6aebb4..9015b38 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -75,6 +75,7 @@ gint        empathy_uint_compare                    (gconstpointer a,
 						     gconstpointer b);
 
 gchar *empathy_protocol_icon_name (const gchar *protocol);
+const gchar *empathy_protocol_name_to_display_name (const gchar *proto_name);
 
 #define EMPATHY_ARRAY_TYPE_OBJECT (empathy_type_dbus_ao ())
 GType empathy_type_dbus_ao (void);



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