pidgin: 9ad255c5: Change theme loaders to use the correct ...

qulogic at pidgin.im qulogic at pidgin.im
Sat Mar 3 22:56:00 EST 2012


----------------------------------------------------------------------
Revision: 9ad255c5981095cb3de15516862f5fb87d9d3db7
Parent:   20584012b920aa1e03b4f4f035414e6e4c453b3a
Author:   qulogic at pidgin.im
Date:     03/03/12 03:19:33
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/9ad255c5981095cb3de15516862f5fb87d9d3db7

Changelog: 

Change theme loaders to use the correct subdirectory now that the
theme manager only gives them the root directory.

Changes against parent 20584012b920aa1e03b4f4f035414e6e4c453b3a

  patched  libpurple/sound-theme-loader.c
  patched  pidgin/gtkblist-theme-loader.c
  patched  pidgin/gtkicon-theme-loader.c

-------------- next part --------------
============================================================
--- libpurple/sound-theme-loader.c	d46e7d010970c85fa999acbb85fdce88dc5ce48c
+++ libpurple/sound-theme-loader.c	79da894f54803211fb380e307f80ab6e26aebe8f
@@ -32,23 +32,26 @@ static PurpleTheme *
  *****************************************************************************/
 
 static PurpleTheme *
-purple_sound_loader_build(const gchar *dir)
+purple_sound_loader_build(const gchar *theme_dir)
 {
 	xmlnode *root_node = NULL, *sub_node;
-	gchar *filename_full, *data = NULL;
+	gchar *dir, *filename_full, *data = NULL;
 	PurpleSoundTheme *theme = NULL;
 	const gchar *name;
 
 	/* 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", "sound", 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", "sound themes", "sound-theme-loader");
 
 	g_free(filename_full);
-	if (root_node == NULL)
+	if (root_node == NULL) {
+		g_free(dir);
 		return NULL;
+	}
 
 	name = xmlnode_get_attrib(root_node, "name");
 
@@ -79,6 +82,7 @@ purple_sound_loader_build(const gchar *d
 
 	xmlnode_free(root_node);
 	g_free(data);
+	g_free(dir);
 	return PURPLE_THEME(theme);
 }
 
============================================================
--- pidgin/gtkblist-theme-loader.c	998de9eccacaf35c081669f51313bbec33ee37f2
+++ pidgin/gtkblist-theme-loader.c	5ba4ae2e14c72624a65d400d9049d9d4b275c42c
@@ -73,10 +73,10 @@ static PurpleTheme *
 }
 
 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 @@ pidgin_blist_loader_build(const gchar *d
 	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 @@ pidgin_blist_loader_build(const gchar *d
 
 	xmlnode_free(root_node);
 	g_free(data);
+	g_free(dir);
 
 	/* malformed xml file - also frees all partial data*/
 	if (!success) {
============================================================
--- pidgin/gtkicon-theme-loader.c	6b0618c4d851c91f26d118ef33ecd2b4b6c996ad
+++ pidgin/gtkicon-theme-loader.c	5e817039653d5b48eb8b2dd3497ba1eb06a94571
@@ -31,23 +31,26 @@ static PurpleTheme *
  *****************************************************************************/
 
 static PurpleTheme *
-pidgin_icon_loader_build(const gchar *dir)
+pidgin_icon_loader_build(const gchar *theme_dir)
 {
 	xmlnode *root_node = NULL, *sub_node;
-	gchar *filename_full, *data = NULL;
+	gchar *dir, *filename_full, *data = NULL;
 	PidginIconTheme *theme = NULL;
 	const gchar *name;
 
 	/* 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", "status-icon", 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", "icon themes", "icon-theme-loader");
 
 	g_free(filename_full);
-	if (root_node == NULL)
+	if (root_node == NULL) {
+		g_free(dir);
 		return NULL;
+	}
 
 	name = xmlnode_get_attrib(root_node, "name");
 


More information about the Commits mailing list