diff src/blist.c @ 8135:8f4ce853e685

[gaim-migrate @ 8840] created a convenience function, and used it. a lot. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 17 Jan 2004 19:36:29 +0000
parents 52cdf2740654
children f347c8d25cf5
line wrap: on
line diff
--- a/src/blist.c	Sat Jan 17 19:21:39 2004 +0000
+++ b/src/blist.c	Sat Jan 17 19:36:29 2004 +0000
@@ -1979,9 +1979,7 @@
 	gaim_blist_add_buddy(buddy, contact, group,
 			gaim_blist_get_last_child((GaimBlistNode*)contact));
 
-	for(x = bnode->child; x; x = x->next) {
-		if(x->type != NODE_TYPE_TAG || strcmp(x->name, "setting"))
-			continue;
+	for(x = xmlnode_get_child(bnode, "setting"); x; x = xmlnode_get_next_twin(x)) {
 		parse_setting((GaimBlistNode*)buddy, x);
 	}
 
@@ -2004,7 +2002,7 @@
 	}
 
 	for(x = cnode->child; x; x = x->next) {
-		if(x->type != NODE_TYPE_TAG)
+		if(x->type != XMLNODE_TYPE_TAG)
 			continue;
 		if(!strcmp(x->name, "buddy"))
 			parse_buddy(group, contact, x);
@@ -2043,11 +2041,9 @@
 
 	components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
 
-	for(x = cnode->child; x; x = x->next) {
+	for(x = xmlnode_get_child(cnode, "component"); x; x = xmlnode_get_next_twin(x)) {
 		const char *name;
 		char *value;
-		if(x->type != NODE_TYPE_TAG || strcmp(x->name, "component"))
-			continue;
 
 		name = xmlnode_get_attrib(x, "name");
 		value = xmlnode_get_data(x);
@@ -2058,9 +2054,7 @@
 	gaim_blist_add_chat(chat, group,
 			gaim_blist_get_last_child((GaimBlistNode*)group));
 
-	for(x = cnode->child; x; x = x->next) {
-		if(x->type != NODE_TYPE_TAG || strcmp(x->name, "setting"))
-			continue;
+	for(x = xmlnode_get_child(cnode, "setting"); x; x = xmlnode_get_next_twin(x)) {
 		parse_setting((GaimBlistNode*)chat, x);
 	}
 
@@ -2083,7 +2077,7 @@
 			gaim_blist_get_last_sibling(gaimbuddylist->root));
 
 	for(cnode = groupnode->child; cnode; cnode = cnode->next) {
-		if(cnode->type != NODE_TYPE_TAG)
+		if(cnode->type != XMLNODE_TYPE_TAG)
 			continue;
 		if(!strcmp(cnode->name, "setting"))
 			parse_setting((GaimBlistNode*)group, cnode);
@@ -2122,11 +2116,8 @@
 	blist = xmlnode_get_child(gaim, "blist");
 	if(blist) {
 		xmlnode *groupnode;
-		for(groupnode = blist->child;  groupnode; groupnode = groupnode->next) {
-			if(groupnode->type != NODE_TYPE_TAG ||
-					strcmp(groupnode->name, "group"))
-				continue;
-
+		for(groupnode = xmlnode_get_child(blist, "group"); groupnode;
+				groupnode = xmlnode_get_next_twin(groupnode)) {
 			parse_group(groupnode);
 		}
 	}
@@ -2156,7 +2147,7 @@
 
 			for(x = anode->child; x; x = x->next) {
 				char *name;
-				if(x->type != NODE_TYPE_TAG)
+				if(x->type != XMLNODE_TYPE_TAG)
 					continue;
 
 				if(!strcmp(x->name, "permit")) {