[empathy] Partial fix for bug #586379



commit 140a3e7349025b41e1a0e7f5bd20e85f41cea75e
Author: Patryk Zawadzki <patrys pld-linux org>
Date:   Fri Jun 19 16:23:57 2009 +0200

    Partial fix for bug #586379
    
    Added naive support for footer files in adium themes. No macros are
    actually parsed and replaces but these are mostly used in headers.

 libempathy-gtk/empathy-theme-adium.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 4aa32a3..9715946 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -86,6 +86,8 @@ theme_adium_load (EmpathyThemeAdium *theme)
 	gchar                 *file;
 	gchar                 *template_html = NULL;
 	gsize                  template_len;
+	gchar                 *footer_html = NULL;
+	gsize                  footer_len;
 	GString               *string;
 	gchar                **strv = NULL;
 	gchar                 *css_path;
@@ -117,6 +119,10 @@ theme_adium_load (EmpathyThemeAdium *theme)
 	g_file_get_contents (file, &priv->status_html, &priv->status_len, NULL);
 	g_free (file);
 
+	file = g_build_filename (priv->basedir, "Footer.html", NULL);
+	g_file_get_contents (file, &footer_html, &footer_len, NULL);
+	g_free (file);
+
 	file = g_build_filename (priv->basedir, "Incoming", "buddy_icon.png", NULL);
 	if (g_file_test (file, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) {
 		priv->default_incoming_avatar_filename = file;
@@ -173,7 +179,8 @@ theme_adium_load (EmpathyThemeAdium *theme)
 	g_string_append (string, strv[i++]);
 	g_string_append (string, ""); /* We don't want header */
 	g_string_append (string, strv[i++]);
-	g_string_append (string, ""); /* FIXME: We don't support footer yet */
+	/* FIXME: We should replace adium %macros% in footer */
+	g_string_append (string, footer_html);
 	g_string_append (string, strv[i++]);
 	priv->template_html = g_string_free (string, FALSE);
 
@@ -182,6 +189,7 @@ theme_adium_load (EmpathyThemeAdium *theme)
 					  priv->template_html, basedir_uri);
 
 	g_free (basedir_uri);
+	g_free (footer_html);
 	g_free (template_html);
 	g_free (css_path);
 	g_strfreev (strv);



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