# HG changeset patch # User Richard Laager # Date 1183242016 0 # Node ID e56531865ea5885353bf4df9fd1d85f2cf84df35 # Parent fafb3af5aa126bf1e691443fda6b69d435f4fe94 Eliminate some duplicate code. diff -r fafb3af5aa12 -r e56531865ea5 pidgin/gtkthemes.c --- a/pidgin/gtkthemes.c Sat Jun 30 22:12:44 2007 +0000 +++ b/pidgin/gtkthemes.c Sat Jun 30 22:20:16 2007 +0000 @@ -47,15 +47,16 @@ } static void -pidgin_themes_destroy_smiley_theme(struct smiley_theme *theme) { - pidgin_themes_destroy_smiley_theme_smileys(theme); +pidgin_themes_destroy_smiley_theme(struct smiley_theme *theme) +{ + pidgin_themes_destroy_smiley_theme_smileys(theme); - g_free(theme->name); - g_free(theme->desc); - g_free(theme->author); - g_free(theme->icon); - g_free(theme->path); - g_free(theme); + g_free(theme->name); + g_free(theme->desc); + g_free(theme->author); + g_free(theme->icon); + g_free(theme->path); + g_free(theme); } static void pidgin_themes_remove_theme_dir(const char *theme_dir_name) @@ -166,18 +167,6 @@ g_hash_table_destroy(already_freed); } -static void smiley_theme_free(struct smiley_theme *theme) -{ - pidgin_themes_destroy_smiley_theme(theme); - - g_free(theme->name); - g_free(theme->desc); - g_free(theme->author); - g_free(theme->icon); - g_free(theme->path); - g_free(theme); -} - static void pidgin_smiley_themes_remove_non_existing() { @@ -191,7 +180,7 @@ if (!g_file_test(theme->path, G_FILE_TEST_EXISTS)) { if (theme == current_smiley_theme) current_smiley_theme = ((struct smiley_theme *)(NULL == iter->next ? NULL : iter->next->data)); - smiley_theme_free(theme); + pidgin_themes_destroy_smiley_theme(theme); iter->data = NULL; } } @@ -332,7 +321,7 @@ if (!theme->name || !theme->desc || !theme->author) { purple_debug_error("gtkthemes", "Invalid file format, not loading smiley theme from '%s'\n", file); - smiley_theme_free(theme); + pidgin_themes_destroy_smiley_theme(theme); return; }