diff libpurple/theme-manager.c @ 25858:1eacf60a73dd

Fix some theme manager assertion failures.
author Richard Laager <rlaager@wiktel.com>
date Mon, 01 Dec 2008 17:04:29 +0000
parents 0de17531e9f2
children 0c7b74fc558e
line wrap: on
line diff
--- a/libpurple/theme-manager.c	Sun Nov 30 17:25:50 2008 +0000
+++ b/libpurple/theme-manager.c	Mon Dec 01 17:04:29 2008 +0000
@@ -20,9 +20,10 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  *
  */
-
+#include <glib.h>
 #include <string.h>
 
+#include "internal.h"
 #include "theme-manager.h"
 #include "util.h"
 
@@ -67,8 +68,8 @@
 static gchar *
 purple_theme_manager_make_key(const gchar *name, const gchar *type)
 {
-	g_return_val_if_fail(name && strlen(name), NULL);
-	g_return_val_if_fail(type && strlen(type), NULL);		
+	g_return_val_if_fail(name && *name, NULL);
+	g_return_val_if_fail(type && *type, NULL);		
 	return g_strconcat(type, "/", name, NULL);
 }
 
@@ -109,12 +110,13 @@
 
 	rdir = g_dir_open(root, 0, NULL);
 
-	g_return_if_fail(rdir);
+	if (!rdir)
+		return;
 
 	/* Parses directory by root/name/purple/type */
 	while((name = g_dir_read_name(rdir))) {
 		purple_dir = g_build_filename(root, name, "purple", NULL);
-		tdir =  g_dir_open(purple_dir, 0, NULL);
+		tdir = g_dir_open(purple_dir, 0, NULL);
 	
 		if(!tdir) {
 			g_free(purple_dir);
@@ -150,9 +152,9 @@
 purple_theme_manager_init(void)
 {
 	theme_table = g_hash_table_new_full(g_str_hash,
-               	                             g_str_equal,
-               	                             g_free,
-               	                             g_object_unref);
+	       	                             g_str_equal,
+	       	                             g_free,
+	       	                             g_object_unref);
 }
 
 void