iconfig's caching was a bit buggy - it didn't notice if some config node was

removed.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@213 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-05-10 13:57:42 +00:00 committed by cras
commit bb4d7566c2
12 changed files with 106 additions and 62 deletions

View file

@ -43,15 +43,15 @@ static void channel_config_add(SETUP_CHANNEL_REC *channel)
node = iconfig_node_traverse("(channels", TRUE);
node = config_node_section(node, NULL, NODE_TYPE_BLOCK);
config_node_set_str(node, "name", channel->name);
config_node_set_str(node, "ircnet", channel->ircnet);
iconfig_node_set_str(node, "name", channel->name);
iconfig_node_set_str(node, "ircnet", channel->ircnet);
if (channel->autojoin)
config_node_set_bool(node, "autojoin", TRUE);
config_node_set_str(node, "password", channel->password);
config_node_set_str(node, "botmasks", channel->botmasks);
config_node_set_str(node, "autosendcmd", channel->autosendcmd);
config_node_set_str(node, "background", channel->background);
config_node_set_str(node, "font", channel->font);
iconfig_node_set_str(node, "password", channel->password);
iconfig_node_set_str(node, "botmasks", channel->botmasks);
iconfig_node_set_str(node, "autosendcmd", channel->autosendcmd);
iconfig_node_set_str(node, "background", channel->background);
iconfig_node_set_str(node, "font", channel->font);
}
static void channel_config_remove(SETUP_CHANNEL_REC *channel)
@ -59,7 +59,7 @@ static void channel_config_remove(SETUP_CHANNEL_REC *channel)
CONFIG_NODE *node;
node = iconfig_node_traverse("channels", FALSE);
if (node != NULL) config_node_list_remove(node, g_slist_index(setupchannels, channel));
if (node != NULL) iconfig_node_list_remove(node, g_slist_index(setupchannels, channel));
}
void channels_setup_create(SETUP_CHANNEL_REC *channel)

View file

@ -164,18 +164,18 @@ static void ignore_set_config(IGNORE_REC *rec)
node = iconfig_node_traverse("(ignores", TRUE);
node = config_node_section(node, NULL, NODE_TYPE_BLOCK);
if (rec->mask != NULL) config_node_set_str(node, "mask", rec->mask);
if (rec->mask != NULL) iconfig_node_set_str(node, "mask", rec->mask);
if (rec->level) {
levelstr = bits2level(rec->level);
config_node_set_str(node, "level", levelstr);
iconfig_node_set_str(node, "level", levelstr);
g_free(levelstr);
}
if (rec->except_level) {
levelstr = bits2level(rec->except_level);
config_node_set_str(node, "except_level", levelstr);
iconfig_node_set_str(node, "except_level", levelstr);
g_free(levelstr);
}
config_node_set_str(node, "pattern", rec->pattern);
iconfig_node_set_str(node, "pattern", rec->pattern);
if (rec->regexp) config_node_set_bool(node, "regexp", TRUE);
if (rec->fullword) config_node_set_bool(node, "fullword", TRUE);
@ -210,7 +210,7 @@ static void ignore_remove_config(IGNORE_REC *rec)
CONFIG_NODE *node;
node = iconfig_node_traverse("ignores", FALSE);
if (node != NULL) config_node_list_remove(node, ignore_index(rec));
if (node != NULL) iconfig_node_list_remove(node, ignore_index(rec));
}
void ignore_add_rec(IGNORE_REC *rec)

View file

@ -261,12 +261,12 @@ void setupserver_config_add(SETUP_SERVER_REC *rec)
node = iconfig_node_traverse("(servers", TRUE);
node = config_node_section(node, NULL, NODE_TYPE_BLOCK);
config_node_set_str(node, "address", rec->address);
config_node_set_str(node, "ircnet", rec->ircnet);
iconfig_node_set_str(node, "address", rec->address);
iconfig_node_set_str(node, "ircnet", rec->ircnet);
config_node_set_int(node, "port", rec->port);
config_node_set_str(node, "password", rec->password);
config_node_set_str(node, "own_host", rec->own_host);
iconfig_node_set_str(node, "password", rec->password);
iconfig_node_set_str(node, "own_host", rec->own_host);
if (rec->autoconnect)
config_node_set_bool(node, "autoconnect", TRUE);
@ -282,7 +282,7 @@ void setupserver_config_remove(SETUP_SERVER_REC *rec)
CONFIG_NODE *node;
node = iconfig_node_traverse("servers", FALSE);
if (node != NULL) config_node_list_remove(node, g_slist_index(setupservers, rec));
if (node != NULL) iconfig_node_list_remove(node, g_slist_index(setupservers, rec));
}
static void setupserver_destroy(SETUP_SERVER_REC *rec)

View file

@ -35,14 +35,14 @@ void notifylist_add_config(NOTIFYLIST_REC *rec)
if (rec->away_check)
config_node_set_bool(node, "away_check", TRUE);
else
config_node_set_str(node, "away_check", NULL);
iconfig_node_set_str(node, "away_check", NULL);
if (rec->idle_check_time > 0)
config_node_set_int(node, "idle_check_time", rec->idle_check_time/60);
else
config_node_set_str(node, "idle_check_time", NULL);
iconfig_node_set_str(node, "idle_check_time", NULL);
config_node_set_str(node, "ircnets", NULL);
iconfig_node_set_str(node, "ircnets", NULL);
if (rec->ircnets != NULL && *rec->ircnets != NULL) {
node = config_node_section(node, "ircnets", NODE_TYPE_LIST);
config_node_add_list(node, rec->ircnets);