From 1bcccdbc977cc35af2edccc9b222d53a63a8c0b6 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Wed, 29 Jul 2009 16:46:24 +0200 Subject: Add a utility function to may protocols to their icons --- libempathy/empathy-account.c | 2 +- libempathy/empathy-utils.c | 6 ++++++ libempathy/empathy-utils.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) (limited to 'libempathy') diff --git a/libempathy/empathy-account.c b/libempathy/empathy-account.c index cc982aea7..db2ca1f56 100644 --- a/libempathy/empathy-account.c +++ b/libempathy/empathy-account.c @@ -467,7 +467,7 @@ empathy_account_constructed (GObject *object) empathy_account_parse_unique_name (priv->unique_name, &(priv->proto_name), &(priv->cm_name)); - priv->icon_name = g_strdup_printf ("im-%s", priv->proto_name); + priv->icon_name = empathy_protocol_icon_name (priv->proto_name); tp_cli_account_connect_to_account_property_changed (priv->account, empathy_account_properties_changed, diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c index 525f2fe06..fe54ce85a 100644 --- a/libempathy/empathy-utils.c +++ b/libempathy/empathy-utils.c @@ -363,6 +363,12 @@ empathy_uint_compare (gconstpointer a, return *(guint *) a - *(guint *) b; } +gchar * +empathy_protocol_icon_name (const gchar *protocol) +{ + return g_strdup_printf ("im-%s", protocol); +} + GType empathy_type_dbus_ao (void) { diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h index 3de6047f4..59ea15403 100644 --- a/libempathy/empathy-utils.h +++ b/libempathy/empathy-utils.h @@ -77,6 +77,8 @@ gboolean empathy_check_available_state (void); gint empathy_uint_compare (gconstpointer a, gconstpointer b); +gchar *empathy_protocol_icon_name (const gchar *protocol); + #define EMPATHY_ARRAY_TYPE_OBJECT (empathy_type_dbus_ao ()) GType empathy_type_dbus_ao (void); -- cgit v1.2.3