Mercurial > pidgin
diff libpurple/prefs.c @ 25918:bc8d1607f9b8
propagate from branch 'im.pidgin.pidgin' (head 566d2e86bfd45c806aba1b32d6f85a9a409ff9ea)
to branch 'im.pidgin.pidgin.next.minor' (head ffd76856f93610f7cd6178e943d0b61e4220b549)
author | Richard Laager <rlaager@wiktel.com> |
---|---|
date | Mon, 26 Jan 2009 02:39:55 +0000 |
parents | 3687049b4faf |
children | 8290e36a5a73 |
line wrap: on
line diff
--- a/libpurple/prefs.c Mon Jan 26 02:39:50 2009 +0000 +++ b/libpurple/prefs.c Mon Jan 26 02:39:55 2009 +0000 @@ -250,33 +250,34 @@ GString *pref_name_full; GList *tmp; - if(strcmp(element_name, "pref") && strcmp(element_name, "item")) + if(!purple_strequal(element_name, "pref") && + !purple_strequal(element_name, "item")) return; for(i = 0; attribute_names[i]; i++) { - if(!strcmp(attribute_names[i], "name")) { + if(purple_strequal(attribute_names[i], "name")) { pref_name = attribute_values[i]; - } else if(!strcmp(attribute_names[i], "type")) { - if(!strcmp(attribute_values[i], "bool")) + } else if(purple_strequal(attribute_names[i], "type")) { + if(purple_strequal(attribute_values[i], "bool")) pref_type = PURPLE_PREF_BOOLEAN; - else if(!strcmp(attribute_values[i], "int")) + else if(purple_strequal(attribute_values[i], "int")) pref_type = PURPLE_PREF_INT; - else if(!strcmp(attribute_values[i], "string")) + else if(purple_strequal(attribute_values[i], "string")) pref_type = PURPLE_PREF_STRING; - else if(!strcmp(attribute_values[i], "stringlist")) + else if(purple_strequal(attribute_values[i], "stringlist")) pref_type = PURPLE_PREF_STRING_LIST; - else if(!strcmp(attribute_values[i], "path")) + else if(purple_strequal(attribute_values[i], "path")) pref_type = PURPLE_PREF_PATH; - else if(!strcmp(attribute_values[i], "pathlist")) + else if(purple_strequal(attribute_values[i], "pathlist")) pref_type = PURPLE_PREF_PATH_LIST; else return; - } else if(!strcmp(attribute_names[i], "value")) { + } else if(purple_strequal(attribute_names[i], "value")) { pref_value = attribute_values[i]; } } - if(!strcmp(element_name, "item")) { + if(purple_strequal(element_name, "item")) { struct purple_pref *pref; pref_name_full = g_string_new(""); @@ -301,7 +302,7 @@ } else { char *decoded; - if(!pref_name || !strcmp(pref_name, "/")) + if(!pref_name || purple_strequal(pref_name, "/")) return; pref_name_full = g_string_new(pref_name); @@ -352,7 +353,7 @@ const gchar *element_name, gpointer user_data, GError **error) { - if(prefs_stack && !strcmp(element_name, "pref")) { + if(prefs_stack && purple_strequal(element_name, "pref")) { g_free(prefs_stack->data); prefs_stack = g_list_delete_link(prefs_stack, prefs_stack); } @@ -521,7 +522,7 @@ char *parent_name = get_path_dirname(name); struct purple_pref *ret = &prefs; - if(strcmp(parent_name, "/")) { + if(!purple_strequal(parent_name, "/")) { ret = find_pref(parent_name); } @@ -571,7 +572,7 @@ my_name = get_path_basename(name); for(sibling = parent->first_child; sibling; sibling = sibling->sibling) { - if(!strcmp(sibling->name, my_name)) { + if(purple_strequal(sibling->name, my_name)) { g_free(my_name); return NULL; } @@ -849,10 +850,7 @@ return; } - if((value && !pref->value.string) || - (!value && pref->value.string) || - (value && pref->value.string && - strcmp(pref->value.string, value))) { + if (!purple_strequal(pref->value.string, value)) { g_free(pref->value.string); pref->value.string = g_strdup(value); do_callbacks(name, pref); @@ -909,10 +907,7 @@ return; } - if((value && !pref->value.string) || - (!value && pref->value.string) || - (value && pref->value.string && - strcmp(pref->value.string, value))) { + if (!purple_strequal(pref->value.string, value)) { g_free(pref->value.string); pref->value.string = g_strdup(value); do_callbacks(name, pref); @@ -1106,7 +1101,7 @@ next = child->sibling; for(newchild = newpref->first_child; newchild != NULL; newchild = newchild->sibling) { - if(!strcmp(child->name, newchild->name)) + if(purple_strequal(child->name, newchild->name)) { purple_prefs_rename_node(child, newchild); break;