changeset 28950:8f62997d90b7

Remove some code duplication which also fixes a small inconsistency in the formatting.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 16 Nov 2009 07:08:27 +0000
parents 97fcfefdbda7
children b26b9f8c9dbd
files pidgin/gtkprefs.c
diffstat 1 files changed, 13 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkprefs.c	Mon Nov 16 07:04:32 2009 +0000
+++ b/pidgin/gtkprefs.c	Mon Nov 16 07:08:27 2009 +0000
@@ -342,6 +342,17 @@
 	notebook_page = 0;
 }
 
+static gchar *
+get_theme_markup(const char *name, gboolean custom, const char *author,
+				 const char *description)
+{
+
+	return g_strdup_printf("<b>%s</b>%s%s%s%s\n<span foreground='dim grey'>%s</span>",
+						   name, custom ? " " : "", custom ? _("(Custom)") : "",
+						   author != NULL ? " - " : "", author != NULL ? author : "",
+						   description != NULL ? description : "");
+}
+
 static void
 theme_refresh_theme_list(void)
 {
@@ -356,9 +367,8 @@
 
 	while (themes) {
 		struct smiley_theme *theme = themes->data;
-		char *description = g_strdup_printf("<span size='larger' weight='bold'>%s</span> - %s\n"
-						    "<span size='smaller' foreground='dim grey'>%s</span>",
-						    _(theme->name), _(theme->author), _(theme->desc));
+		char *description = get_theme_markup(_(theme->name), FALSE,
+		                                     _(theme->author), _(theme->desc));
 		gtk_list_store_append(prefs_smiley_themes, &iter);
 
 		/*
@@ -381,17 +391,6 @@
 	}
 }
 
-static gchar *
-get_theme_markup(const char *name, gboolean custom, const char *author,
-				 const char *description)
-{
-
-	return g_strdup_printf("<b>%s</b>%s%s%s%s\n<span foreground='dim grey'>%s</span>",
-						   name, custom ? " " : "", custom ? _("(Custom)") : "",
-						   author != NULL ? " - " : "", author != NULL ? author : "",
-						   description != NULL ? description : "");
-}
-
 /* Rebuild the markup for the sound theme selection for "(Custom)" themes */
 static void
 pref_sound_generate_markup(void)