summaryrefslogtreecommitdiff
path: root/libpurple/prefs.c
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2009-01-06 04:09:36 +0000
committerGary Kramlich <grim@reaperworld.com>2009-01-06 04:09:36 +0000
commit1ca29c5d951b7bd4258a7b1ce42ff6b4d7763cfe (patch)
tree897fdf4102ec73ad07e0ff446efcf0f287017ff2 /libpurple/prefs.c
parentf14540566eecb54e4264d6c81a138b745571f545 (diff)
parentd4e52f0c304142a80a2f80648ec4c7c40e6b4c18 (diff)
downloadpidgin-1ca29c5d951b7bd4258a7b1ce42ff6b4d7763cfe.tar.gz
propagate from branch 'im.pidgin.pidgin' (head ea172b7ea6011593301a840b09604c083bfbabef)
to branch 'im.pidgin.pidgin.next.minor' (head 2c3a4932fafe56aeea9be99b80d14dcfa5b65476)
Diffstat (limited to 'libpurple/prefs.c')
-rw-r--r--libpurple/prefs.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/libpurple/prefs.c b/libpurple/prefs.c
index b95d2be610..162045c7be 100644
--- a/libpurple/prefs.c
+++ b/libpurple/prefs.c
@@ -250,33 +250,34 @@ prefs_start_element_handler (GMarkupParseContext *context,
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 @@ prefs_start_element_handler (GMarkupParseContext *context,
} 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 @@ prefs_end_element_handler(GMarkupParseContext *context,
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 @@ find_pref_parent(const char *name)
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 @@ add_pref(PurplePrefType type, const char *name)
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 @@ purple_prefs_set_string(const char *name, const char *value)
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 @@ purple_prefs_set_path(const char *name, const char *value)
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 @@ purple_prefs_rename_node(struct purple_pref *oldpref, struct purple_pref *newpre
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;