diff libpurple/theme-manager.c @ 25088:9ffbfbcf307d

Fixed purple sound loader class init function (bug on startup) and added shell sound theme selector
author Justin Rodriguez <ffdragon@soc.pidgin.im>
date Sat, 21 Jun 2008 05:55:58 +0000
parents 51bdbab30704
children d60c3d1c6966
line wrap: on
line diff
--- a/libpurple/theme-manager.c	Tue Jun 17 03:26:00 2008 +0000
+++ b/libpurple/theme-manager.c	Sat Jun 21 05:55:58 2008 +0000
@@ -28,7 +28,7 @@
  * Globals
  *****************************************************************************/
 
-static GHashTable *theme_table;
+static GHashTable *theme_table = NULL;
 
 /*****************************************************************************
  * GObject Stuff                                                     
@@ -147,7 +147,7 @@
 	va_list args;
 	PurpleThemeLoader *loader;
 
-	g_return_if_fail(theme_table != NULL);
+	/*g_return_if_fail(theme_table != NULL);*/
 
 	theme_table = g_hash_table_new_full (g_str_hash,
                	                             g_str_equal,
@@ -160,7 +160,7 @@
 	va_end(args);
 
 	/* TODO: add themes properly */
-	purple_theme_manager_build_dir(NULL);
+	purple_theme_manager_build_dir("/usr/share/themes");
 }
 
 void 
@@ -171,7 +171,7 @@
                 	             NULL);	
 	
 	/* TODO: this also needs to be fixed the same as new */
-	purple_theme_manager_build_dir(NULL);
+	purple_theme_manager_build_dir("/usr/share/themes");
 
 }
 
@@ -189,14 +189,12 @@
 
 	g_return_if_fail(PURPLE_IS_THEME_LOADER(loader));
 
-	type = purple_theme_loader_get_type_string(loader);
+	type = g_strdup(purple_theme_loader_get_type_string(loader));
 	g_return_if_fail(type);
 
 	/* if something is already there do nothing */
 	if (! g_hash_table_lookup (theme_table, type)) 
 		g_hash_table_insert(theme_table, type, loader);
-	
-	g_free(type);
 }
 
 void