changeset 23470:c32dd71d0658

Fixed a few small problems with the sound loader and sound theme
author Justin Rodriguez <ffdragon@soc.pidgin.im>
date Fri, 27 Jun 2008 18:04:29 +0000
parents e8be608b6bab
children ef66901f74f5
files libpurple/sound-loader.c libpurple/sound-theme.c libpurple/theme-manager.c pidgin/gtksound.c
diffstat 4 files changed, 9 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/sound-loader.c	Fri Jun 27 03:44:28 2008 +0000
+++ b/libpurple/sound-loader.c	Fri Jun 27 18:04:29 2008 +0000
@@ -71,15 +71,15 @@
 			    "name", xmlnode_get_attrib(root_node, "name"),
 			    "author", xmlnode_get_attrib(root_node, "author"),
 			    "image", preview,
+			    "directory", dir,
 			    "description", data, NULL);
 	
 	xmlnode_free(sub_node);
 
 	while ((sub_node = xmlnode_get_child(root_node, "event")) != NULL){
 		purple_sound_theme_set_file(theme,
-					    xmlnode_get_attrib(root_node, "name"),
-					    xmlnode_get_attrib(root_node, "file"));
-
+					    xmlnode_get_attrib(sub_node, "name"),
+					    xmlnode_get_attrib(sub_node, "file"));
 		xmlnode_free(sub_node);
 	}
 
--- a/libpurple/sound-theme.c	Fri Jun 27 03:44:28 2008 +0000
+++ b/libpurple/sound-theme.c	Fri Jun 27 18:04:29 2008 +0000
@@ -144,9 +144,6 @@
 
 	full = g_build_filename(dir, filename, NULL);
 
-	g_free(dir);
-	g_free(filename);
-
 	return full;
 }
 
@@ -157,10 +154,10 @@
 {
 	PurpleSoundThemePrivate *priv;
 	g_return_if_fail(PURPLE_IS_SOUND_THEME(theme));
-
+	
 	priv = PURPLE_SOUND_THEME_GET_PRIVATE(theme);
-	
-	if (filename)g_hash_table_replace(priv->sound_files,
+
+	if (filename != NULL)g_hash_table_replace(priv->sound_files,
                  	             g_strdup(event),
                         	     g_strdup(filename));
 	else g_hash_table_remove(priv->sound_files, event);
--- a/libpurple/theme-manager.c	Fri Jun 27 03:44:28 2008 +0000
+++ b/libpurple/theme-manager.c	Fri Jun 27 18:04:29 2008 +0000
@@ -226,8 +226,8 @@
 	g_return_val_if_fail(name, NULL);
 	g_return_val_if_fail(type, NULL);
 
-	return g_hash_table_lookup (theme_table,
-				    purple_theme_manager_make_key(name, type));
+	return g_hash_table_lookup(theme_table, 
+				   purple_theme_manager_make_key(name, type));
 }
 
 
--- a/pidgin/gtksound.c	Fri Jun 27 03:44:28 2008 +0000
+++ b/pidgin/gtksound.c	Fri Jun 27 18:04:29 2008 +0000
@@ -560,7 +560,7 @@
 {
 	char *enable_pref;
 	char *file_pref;
-	char *theme_pref, *theme_name;
+	char *theme_name;
 	PurpleSoundTheme *theme;
 
 	if ((event == PURPLE_SOUND_BUDDY_ARRIVE) && mute_login_sounds)