changeset 5444:dec7e222a68b

[gaim-migrate @ 5826] this will make things work until I decide if I want gaim_prefs_set_* to create prefs if they're not there committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sun, 18 May 2003 22:35:58 +0000
parents 07358c067495
children ad9b6e65713b
files src/prefs.c
diffstat 1 files changed, 29 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/prefs.c	Sun May 18 22:35:14 2003 +0000
+++ b/src/prefs.c	Sun May 18 22:35:58 2003 +0000
@@ -517,19 +517,35 @@
 
 	pref_name_full = g_string_prepend_c(pref_name_full, '/');
 
-	switch(pref_type) {
-		case GAIM_PREF_NONE:
-			gaim_prefs_add_none(pref_name_full->str);
-			break;
-		case GAIM_PREF_BOOLEAN:
-			gaim_prefs_add_bool(pref_name_full->str, atoi(pref_value));
-			break;
-		case GAIM_PREF_INT:
-			gaim_prefs_add_int(pref_name_full->str, atoi(pref_value));
-			break;
-		case GAIM_PREF_STRING:
-			gaim_prefs_add_string(pref_name_full->str, pref_value);
-			break;
+	if(find_pref(pref_name_full->str)) {
+		switch(pref_type) {
+			case GAIM_PREF_NONE:
+				gaim_prefs_add_none(pref_name_full->str);
+				break;
+			case GAIM_PREF_BOOLEAN:
+				gaim_prefs_add_bool(pref_name_full->str, atoi(pref_value));
+				break;
+			case GAIM_PREF_INT:
+				gaim_prefs_add_int(pref_name_full->str, atoi(pref_value));
+				break;
+			case GAIM_PREF_STRING:
+				gaim_prefs_add_string(pref_name_full->str, pref_value);
+				break;
+		}
+	} else {
+		switch(pref_type) {
+			case GAIM_PREF_NONE:
+				break;
+			case GAIM_PREF_BOOLEAN:
+				gaim_prefs_set_bool(pref_name_full->str, atoi(pref_value));
+				break;
+			case GAIM_PREF_INT:
+				gaim_prefs_set_int(pref_name_full->str, atoi(pref_value));
+				break;
+			case GAIM_PREF_STRING:
+				gaim_prefs_set_string(pref_name_full->str, pref_value);
+				break;
+		}
 	}
 
 	prefs_stack = g_list_prepend(prefs_stack, g_strdup(pref_name));