Mercurial > pidgin
diff pidgin/gtkblist-theme-loader.c @ 32730:f7be1e356a23
Change theme loaders to use the correct subdirectory now that the
theme manager only gives them the root directory.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 03 Mar 2012 08:19:33 +0000 |
parents | a8cc50c2279f |
children |
line wrap: on
line diff
--- a/pidgin/gtkblist-theme-loader.c Sat Mar 03 07:47:07 2012 +0000 +++ b/pidgin/gtkblist-theme-loader.c Sat Mar 03 08:19:33 2012 +0000 @@ -73,10 +73,10 @@ } static PurpleTheme * -pidgin_blist_loader_build(const gchar *dir) +pidgin_blist_loader_build(const gchar *theme_dir) { xmlnode *root_node = NULL, *sub_node, *sub_sub_node; - gchar *filename_full, *data = NULL; + gchar *dir, *filename_full, *data = NULL; const gchar *temp, *name; gboolean success = TRUE; GdkColor *bgcolor, *expanded_bgcolor, *collapsed_bgcolor, *contact_color; @@ -112,15 +112,18 @@ status = NULL; /* Find the theme file */ - g_return_val_if_fail(dir != NULL, NULL); + g_return_val_if_fail(theme_dir != NULL, NULL); + dir = g_build_filename(theme_dir, "purple", "blist", NULL); filename_full = g_build_filename(dir, "theme.xml", NULL); if (g_file_test(filename_full, G_FILE_TEST_IS_REGULAR)) root_node = xmlnode_from_file(dir, "theme.xml", "buddy list themes", "blist-loader"); g_free(filename_full); - if (root_node == NULL) + if (root_node == NULL) { + g_free(dir); return NULL; + } sub_node = xmlnode_get_child(root_node, "description"); data = xmlnode_get_data(sub_node); @@ -227,6 +230,7 @@ xmlnode_free(root_node); g_free(data); + g_free(dir); /* malformed xml file - also frees all partial data*/ if (!success) {