# HG changeset patch # User Elliott Sales de Andrade # Date 1258355307 0 # Node ID 8f62997d90b7451f6c3d0d5460389bfe8a75ec62 # Parent 97fcfefdbda7bcdb2d1086094596a154d06bd0a4 Remove some code duplication which also fixes a small inconsistency in the formatting. diff -r 97fcfefdbda7 -r 8f62997d90b7 pidgin/gtkprefs.c --- 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("%s%s%s%s%s\n%s", + 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("%s - %s\n" - "%s", - _(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("%s%s%s%s%s\n%s", - 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)