Changeset e222c36
- Timestamp:
- 2012-06-07T22:45:24Z (12 years ago)
- Branches:
- master
- Children:
- 297d1d02
- Parents:
- bb5ce568
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
storage_xml.c
rbb5ce568 re222c36 251 251 252 252 static gboolean xml_generate_nick( gpointer key, gpointer value, gpointer data ); 253 static void xml_generate_settings( struct xt_node *cur, set_t **head ); 253 254 254 255 struct xt_node *xml_generate( irc_t *irc ) 255 256 { 256 257 char *pass_buf = NULL; 257 set_t *set;258 258 account_t *acc; 259 259 md5_byte_t pass_md5[21]; … … 280 280 g_free( pass_buf ); 281 281 282 for( set = irc->b->set; set; set = set->next ) 283 if( set->value && !( set->flags & SET_NOSAVE ) ) 284 { 285 struct xt_node *xset; 286 xt_add_child( cur, xset = xt_new_node( "setting", set->value, NULL ) ); 287 xt_add_attr( xset, "name", set->key ); 288 } 282 xml_generate_settings( cur, &irc->b->set ); 289 283 290 284 for( acc = irc->b->accounts; acc; acc = acc->next ) … … 309 303 g_free( pass_b64 ); 310 304 311 for( set = acc->set; set; set = set->next )312 if( set->value && !( set->flags & SET_NOSAVE ) )313 {314 struct xt_node *xset;315 xt_add_child( cur, xset = xt_new_node( "setting", set->value, NULL ) );316 xt_add_attr( xset, "name", set->key );317 }318 319 305 /* This probably looks pretty strange. g_hash_table_foreach 320 306 is quite a PITA already (but it can't get much better in … … 326 312 g_hash_table_find( acc->nicks, xml_generate_nick, cur ); 327 313 314 xml_generate_settings( cur, &acc->set ); 315 328 316 xt_add_child( root, cur ); 329 317 } … … 340 328 xt_add_attr( cur, "type", set_getstr( &ic->set, "type" ) ); 341 329 342 for( set = ic->set; set; set = set->next ) 343 if( set->value && strcmp( set->key, "type" ) != 0 ) 344 { 345 struct xt_node *xset; 346 xt_add_child( cur, xset = xt_new_node( "setting", set->value, NULL ) ); 347 xt_add_attr( xset, "name", set->key ); 348 } 330 xml_generate_settings( cur, &ic->set ); 349 331 350 332 xt_add_child( root, cur ); … … 362 344 363 345 return FALSE; 346 } 347 348 static void xml_generate_settings( struct xt_node *cur, set_t **head ) 349 { 350 set_t *set; 351 352 for( set = *head; set; set = set->next ) 353 if( set->value && !( set->flags & SET_NOSAVE ) ) 354 { 355 struct xt_node *xset; 356 xt_add_child( cur, xset = xt_new_node( "setting", set->value, NULL ) ); 357 xt_add_attr( xset, "name", set->key ); 358 } 364 359 } 365 360
Note: See TracChangeset
for help on using the changeset viewer.