mirror of
https://github.com/irssi/irssi.git
synced 2025-01-03 14:56:47 -05:00
Query bugfixes
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1048 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
3ef279fd1c
commit
ebeb48d307
@ -47,15 +47,16 @@ void query_init(QUERY_REC *query, int automatic)
|
||||
g_return_if_fail(query->name != NULL);
|
||||
|
||||
queries = g_slist_append(queries, query);
|
||||
if (query->server != NULL) {
|
||||
query->server->queries =
|
||||
g_slist_append(query->server->queries, query);
|
||||
}
|
||||
|
||||
MODULE_DATA_INIT(query);
|
||||
query->type = module_get_uniq_id_str("WINDOW ITEM TYPE", "QUERY");
|
||||
if (query->server_tag != NULL)
|
||||
if (query->server_tag != NULL) {
|
||||
query->server = server_find_tag(query->server_tag);
|
||||
if (query->server != NULL) {
|
||||
query->server->queries =
|
||||
g_slist_append(query->server->queries, query);
|
||||
}
|
||||
}
|
||||
|
||||
signal_emit("query created", 2, query, GINT_TO_POINTER(automatic));
|
||||
}
|
||||
@ -141,6 +142,13 @@ void query_change_server(QUERY_REC *query, SERVER_REC *server)
|
||||
{
|
||||
g_return_if_fail(IS_QUERY(query));
|
||||
|
||||
if (query->server != NULL) {
|
||||
query->server->queries =
|
||||
g_slist_remove(query->server->queries, query);
|
||||
}
|
||||
if (server != NULL)
|
||||
server->queries = g_slist_append(server->queries, query);
|
||||
|
||||
query->server = server;
|
||||
signal_emit("query server changed", 1, query);
|
||||
}
|
||||
|
@ -302,8 +302,8 @@ static int server_remove_channels(SERVER_REC *server)
|
||||
found = TRUE;
|
||||
}
|
||||
|
||||
for (tmp = server->queries; tmp != NULL; tmp = tmp->next)
|
||||
query_change_server(tmp->data, NULL);
|
||||
while (server->queries != NULL)
|
||||
query_change_server(server->queries->data, NULL);
|
||||
|
||||
g_slist_free(server->channels);
|
||||
g_slist_free(server->queries);
|
||||
|
Loading…
Reference in New Issue
Block a user