aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-29 22:46:24 +0800
committerSjoerd Simons <sjoerd.simons@collabora.co.uk>2009-07-29 22:50:38 +0800
commit1bcccdbc977cc35af2edccc9b222d53a63a8c0b6 (patch)
treebb4e20bed2328278f89eaa3f84d21e656b774990
parente5a8856fbc12280af273c8329ee08ba4e6e3a044 (diff)
downloadgsoc2013-empathy-1bcccdbc977cc35af2edccc9b222d53a63a8c0b6.tar
gsoc2013-empathy-1bcccdbc977cc35af2edccc9b222d53a63a8c0b6.tar.gz
gsoc2013-empathy-1bcccdbc977cc35af2edccc9b222d53a63a8c0b6.tar.bz2
gsoc2013-empathy-1bcccdbc977cc35af2edccc9b222d53a63a8c0b6.tar.lz
gsoc2013-empathy-1bcccdbc977cc35af2edccc9b222d53a63a8c0b6.tar.xz
gsoc2013-empathy-1bcccdbc977cc35af2edccc9b222d53a63a8c0b6.tar.zst
gsoc2013-empathy-1bcccdbc977cc35af2edccc9b222d53a63a8c0b6.zip
Add a utility function to may protocols to their icons
-rw-r--r--libempathy-gtk/empathy-protocol-chooser.c3
-rw-r--r--libempathy/empathy-account.c2
-rw-r--r--libempathy/empathy-utils.c6
-rw-r--r--libempathy/empathy-utils.h2
4 files changed, 10 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-protocol-chooser.c b/libempathy-gtk/empathy-protocol-chooser.c
index ebb198455..c17dfc526 100644
--- a/libempathy-gtk/empathy-protocol-chooser.c
+++ b/libempathy-gtk/empathy-protocol-chooser.c
@@ -134,8 +134,7 @@ protocol_choosers_add_cm (EmpathyProtocolChooser *chooser,
gchar *icon_name;
gchar *display_name;
-
- icon_name = g_strdup_printf ("im-%s", proto->name);
+ icon_name = empathy_protocol_icon_name (proto->name);
if (!tp_strdiff (cm->name, "haze"))
display_name = g_strdup_printf ("%s (Haze)", proto->name);
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);