comparison pidgin/gtkicon-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 9ad4b5200f24
children
comparison
equal deleted inserted replaced
32729:b276701931d9 32730:f7be1e356a23
29 /***************************************************************************** 29 /*****************************************************************************
30 * Icon Theme Builder 30 * Icon Theme Builder
31 *****************************************************************************/ 31 *****************************************************************************/
32 32
33 static PurpleTheme * 33 static PurpleTheme *
34 pidgin_icon_loader_build(const gchar *dir) 34 pidgin_icon_loader_build(const gchar *theme_dir)
35 { 35 {
36 xmlnode *root_node = NULL, *sub_node; 36 xmlnode *root_node = NULL, *sub_node;
37 gchar *filename_full, *data = NULL; 37 gchar *dir, *filename_full, *data = NULL;
38 PidginIconTheme *theme = NULL; 38 PidginIconTheme *theme = NULL;
39 const gchar *name; 39 const gchar *name;
40 40
41 /* Find the theme file */ 41 /* Find the theme file */
42 g_return_val_if_fail(dir != NULL, NULL); 42 g_return_val_if_fail(theme_dir != NULL, NULL);
43 dir = g_build_filename(theme_dir, "purple", "status-icon", NULL);
43 filename_full = g_build_filename(dir, "theme.xml", NULL); 44 filename_full = g_build_filename(dir, "theme.xml", NULL);
44 45
45 if (g_file_test(filename_full, G_FILE_TEST_IS_REGULAR)) 46 if (g_file_test(filename_full, G_FILE_TEST_IS_REGULAR))
46 root_node = xmlnode_from_file(dir, "theme.xml", "icon themes", "icon-theme-loader"); 47 root_node = xmlnode_from_file(dir, "theme.xml", "icon themes", "icon-theme-loader");
47 48
48 g_free(filename_full); 49 g_free(filename_full);
49 if (root_node == NULL) 50 if (root_node == NULL) {
51 g_free(dir);
50 return NULL; 52 return NULL;
53 }
51 54
52 name = xmlnode_get_attrib(root_node, "name"); 55 name = xmlnode_get_attrib(root_node, "name");
53 56
54 if (name) { 57 if (name) {
55 /* Parse the tree */ 58 /* Parse the tree */