From 9f7e19517623ea663dcd54b84b3839fbbf2c582c Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Thu, 17 Jul 2008 10:28:50 +0200 Subject: Add path in EmpathySmiley --- libempathy-gtk/empathy-theme-adium.c | 35 +++++++---------------------------- 1 file changed, 7 insertions(+), 28 deletions(-) (limited to 'libempathy-gtk/empathy-theme-adium.c') diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c index ab773b21c..5277810cf 100644 --- a/libempathy-gtk/empathy-theme-adium.c +++ b/libempathy-gtk/empathy-theme-adium.c @@ -26,6 +26,7 @@ #include #include "empathy-theme-adium.h" +#include "empathy-ui-utils.h" #define DEBUG_FLAG EMPATHY_DEBUG_CHAT #include @@ -163,33 +164,6 @@ theme_adium_escape_body (const gchar *body) return ret; } -static const gchar * -theme_adium_get_default_avatar_filename (EmpathyThemeAdium *theme) -{ - EmpathyThemeAdiumPriv *priv = GET_PRIV (theme); - GtkIconTheme *icon_theme; - GtkIconInfo *icon_info; - gint w, h; - gint size = 48; - - /* Lazy initialization */ - if (priv->default_avatar_filename) { - return priv->default_avatar_filename; - } - - icon_theme = gtk_icon_theme_get_default (); - - if (gtk_icon_size_lookup (GTK_ICON_SIZE_DIALOG, &w, &h)) { - size = (w + h) / 2; - } - - icon_info = gtk_icon_theme_lookup_icon (icon_theme, "stock_person", size, 0); - priv->default_avatar_filename = g_strdup (gtk_icon_info_get_filename (icon_info)); - gtk_icon_info_free (icon_info); - - return priv->default_avatar_filename; -} - static void theme_adium_scroll_down (EmpathyChatView *view) { @@ -233,7 +207,12 @@ theme_adium_append_message (EmpathyChatView *view, avatar_filename = avatar->filename; } if (!avatar_filename) { - avatar_filename = theme_adium_get_default_avatar_filename (theme); + if (!priv->default_avatar_filename) { + priv->default_avatar_filename = + empathy_filename_from_icon_name ("stock_person", + GTK_ICON_SIZE_DIALOG); + } + avatar_filename = priv->default_avatar_filename; } /* Get the right html/func to add the message */ -- cgit v1.2.3