From 4e0f97a1942d1ae0b4b3846d43e3769fdb076b44 Mon Sep 17 00:00:00 2001 From: Marco Barisione Date: Mon, 6 May 2013 14:39:09 +0100 Subject: tpaw-utils: move functions for protocol and service display information The following functions were moved from empathy to tp-aw and renamed accordingly: * empathy_protocol_icon_name; * empathy_protocol_name_to_display_name; * empathy_service_name_to_display_name. This commit also changes the licence of the moved code (all copyrighted by Collabora Ltd.) from GPL to LGPL. https://bugzilla.gnome.org/show_bug.cgi?id=699492 --- libempathy/empathy-utils.c | 86 ---------------------------------------------- libempathy/empathy-utils.h | 4 --- 2 files changed, 90 deletions(-) (limited to 'libempathy') diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index b06edeb01..ee245d90f 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -428,21 +428,6 @@ empathy_uint_compare (gconstpointer a, return *(guint *) a - *(guint *) b; } -gchar * -empathy_protocol_icon_name (const gchar *protocol) -{ - if (!tp_strdiff (protocol, "yahoojp")) - /* Yahoo Japan uses the same icon as Yahoo */ - protocol = "yahoo"; - else if (!tp_strdiff (protocol, "simple")) - /* SIMPLE uses the same icon as SIP */ - protocol = "sip"; - else if (!tp_strdiff (protocol, "sms")) - return g_strdup ("phone"); - - return g_strdup_printf ("im-%s", protocol); -} - GType empathy_type_dbus_ao (void) { @@ -454,77 +439,6 @@ 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; - gboolean translated; - } names[] = { - { "jabber", "Jabber", FALSE }, - { "msn", "Windows Live (MSN)", FALSE, }, - { "local-xmpp", N_("People Nearby"), TRUE }, - { "irc", "IRC", FALSE }, - { "icq", "ICQ", FALSE }, - { "aim", "AIM", FALSE }, - { "yahoo", "Yahoo!", FALSE }, - { "yahoojp", N_("Yahoo! Japan"), TRUE }, - { "groupwise", "GroupWise", FALSE }, - { "sip", "SIP", FALSE }, - { "gadugadu", "Gadu-Gadu", FALSE }, - { "mxit", "Mxit", FALSE }, - { "myspace", "Myspace", FALSE }, - { "sametime", "Sametime", FALSE }, - { "skype-dbus", "Skype (D-BUS)", FALSE }, - { "skype-x11", "Skype (X11)", FALSE }, - { "zephyr", "Zephyr", FALSE }, - { NULL, NULL } - }; - - for (i = 0; names[i].proto != NULL; i++) - { - if (!tp_strdiff (proto_name, names[i].proto)) - { - if (names[i].translated) - return gettext (names[i].display); - else - return names[i].display; - } - } - - return proto_name; -} - -const char * -empathy_service_name_to_display_name (const gchar *service_name) -{ - int i; - static struct { - const gchar *service; - const gchar *display; - gboolean translated; - } names[] = { - { "google-talk", N_("Google Talk"), FALSE }, - { "facebook", N_("Facebook Chat"), TRUE }, - { NULL, NULL } - }; - - for (i = 0; names[i].service != NULL; i++) - { - if (!tp_strdiff (service_name, names[i].service)) - { - if (names[i].translated) - return gettext (names[i].display); - else - return names[i].display; - } - } - - return service_name; -} - gboolean empathy_account_manager_get_accounts_connected (gboolean *connecting) { diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index 1a86755c6..96d201d3e 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -66,10 +66,6 @@ gint empathy_uint_compare (gconstpointer a, const gchar * empathy_account_get_error_message (TpAccount *account, gboolean *user_requested); -gchar *empathy_protocol_icon_name (const gchar *protocol); -const gchar *empathy_protocol_name_to_display_name (const gchar *proto_name); -const gchar *empathy_service_name_to_display_name (const gchar *proto_name); - #define EMPATHY_ARRAY_TYPE_OBJECT (empathy_type_dbus_ao ()) GType empathy_type_dbus_ao (void); -- cgit v1.2.3