changeset 32188:1caf13175039

Be a bit stricter about types in Info.plist.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 19 Sep 2011 20:36:05 +0000
parents a56483e407d4
children 2e8721fceaa5
files pidgin/gtkconv-theme-loader.c pidgin/gtkconv-theme.c
diffstat 2 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkconv-theme-loader.c	Mon Sep 19 20:31:33 2011 +0000
+++ b/pidgin/gtkconv-theme-loader.c	Mon Sep 19 20:36:05 2011 +0000
@@ -134,9 +134,9 @@
 
 	/* Check for required keys: CFBundleName */
 	val = g_hash_table_lookup(info, "CFBundleName");
-	if (!val) {
+	if (!val || !G_VALUE_HOLDS_STRING(val)) {
 		purple_debug_error("gtkconv-theme-loader",
-		                   "%s/Contents/Info.plist missing required key CFBundleName.\n",
+		                   "%s/Contents/Info.plist missing required string key CFBundleName.\n",
 		                   dir);
 		g_hash_table_destroy(info);
 		return NULL;
@@ -145,9 +145,9 @@
 
 	/* Check for required keys: CFBundleIdentifier */
 	val = g_hash_table_lookup(info, "CFBundleIdentifier");
-	if (!val) {
+	if (!val || !G_VALUE_HOLDS_STRING(val)) {
 		purple_debug_error("gtkconv-theme-loader",
-		                   "%s/Contents/Info.plist missing required key CFBundleIdentifier.\n",
+		                   "%s/Contents/Info.plist missing required string key CFBundleIdentifier.\n",
 		                   dir);
 		g_hash_table_destroy(info);
 		return NULL;
@@ -156,9 +156,9 @@
 
 	/* Check for required keys: MessageViewVersion */
 	val = g_hash_table_lookup(info, "MessageViewVersion");
-	if (!val) {
+	if (!val || !G_VALUE_HOLDS_INT(val)) {
 		purple_debug_error("gtkconv-theme-loader",
-		                   "%s/Contents/Info.plist missing required key MessageViewVersion.\n",
+		                   "%s/Contents/Info.plist missing required integer key MessageViewVersion.\n",
 		                   dir);
 		g_hash_table_destroy(info);
 		return NULL;
--- a/pidgin/gtkconv-theme.c	Mon Sep 19 20:31:33 2011 +0000
+++ b/pidgin/gtkconv-theme.c	Mon Sep 19 20:36:05 2011 +0000
@@ -494,15 +494,15 @@
 	g_object_get(G_OBJECT(webview), "settings", &settings, NULL);
 
 	val = get_key(priv, "DefaultFontFamily", TRUE);
-	if (val)
+	if (val && G_VALUE_HOLDS_STRING(val))
 		g_object_set(G_OBJECT(settings), "default-font-family", g_value_get_string(val), NULL);
 
 	val = get_key(priv, "DefaultFontSize", TRUE);
-	if (val)
+	if (val && G_VALUE_HOLDS_INT(val))
 		g_object_set(G_OBJECT(settings), "default-font-size", GINT_TO_POINTER(g_value_get_int(val)), NULL);
 
 	val = get_key(priv, "DefaultBackgroundIsTransparent", TRUE);
-	if (val)
+	if (val && G_VALUE_HOLDS_BOOLEAN(val))
 		/* this does not work :( */
 		webkit_web_view_set_transparent(webview, g_value_get_boolean(val));
 }