mirror of
https://github.com/irssi/irssi.git
synced 2025-02-02 15:08:01 -05:00
Removed window parameter from window_item_remove() and
window_item_destroy() git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1079 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
28465db59c
commit
dd68c2fa5f
@ -58,7 +58,7 @@ static void signal_channel_destroyed(CHANNEL_REC *channel)
|
|||||||
|
|
||||||
window = window_item_window((WI_ITEM_REC *) channel);
|
window = window_item_window((WI_ITEM_REC *) channel);
|
||||||
if (window != NULL) {
|
if (window != NULL) {
|
||||||
window_item_destroy(window, (WI_ITEM_REC *) channel);
|
window_item_destroy((WI_ITEM_REC *) channel);
|
||||||
|
|
||||||
if (window->items == NULL && windows->next != NULL &&
|
if (window->items == NULL && windows->next != NULL &&
|
||||||
(!channel->joined || channel->left) &&
|
(!channel->joined || channel->left) &&
|
||||||
|
@ -80,7 +80,7 @@ static void signal_query_destroyed(QUERY_REC *query)
|
|||||||
|
|
||||||
window = window_item_window((WI_ITEM_REC *) query);
|
window = window_item_window((WI_ITEM_REC *) query);
|
||||||
if (window != NULL) {
|
if (window != NULL) {
|
||||||
window_item_destroy(window, (WI_ITEM_REC *) query);
|
window_item_destroy((WI_ITEM_REC *) query);
|
||||||
|
|
||||||
if (window->items == NULL && windows->next != NULL &&
|
if (window->items == NULL && windows->next != NULL &&
|
||||||
!query->unwanted && settings_get_bool("autoclose_windows"))
|
!query->unwanted && settings_get_bool("autoclose_windows"))
|
||||||
|
@ -114,7 +114,7 @@ void window_destroy(WINDOW_REC *window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (window->items != NULL)
|
while (window->items != NULL)
|
||||||
window_item_destroy(window, window->items->data);
|
window_item_destroy(window->items->data);
|
||||||
|
|
||||||
if (settings_get_bool("windows_auto_renumber"))
|
if (settings_get_bool("windows_auto_renumber"))
|
||||||
windows_pack(window->refnum);
|
windows_pack(window->refnum);
|
||||||
|
@ -58,11 +58,14 @@ void window_item_add(WINDOW_REC *window, WI_ITEM_REC *item, int automatic)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_item_remove(WINDOW_REC *window, WI_ITEM_REC *item)
|
void window_item_remove(WI_ITEM_REC *item)
|
||||||
{
|
{
|
||||||
g_return_if_fail(window != NULL);
|
WINDOW_REC *window;
|
||||||
|
|
||||||
g_return_if_fail(item != NULL);
|
g_return_if_fail(item != NULL);
|
||||||
|
|
||||||
|
window = window_item_window(item);
|
||||||
|
|
||||||
if (g_slist_find(window->items, item) == NULL)
|
if (g_slist_find(window->items, item) == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -77,9 +80,12 @@ void window_item_remove(WINDOW_REC *window, WI_ITEM_REC *item)
|
|||||||
signal_emit("window item remove", 2, window, item);
|
signal_emit("window item remove", 2, window, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void window_item_destroy(WINDOW_REC *window, WI_ITEM_REC *item)
|
void window_item_destroy(WI_ITEM_REC *item)
|
||||||
{
|
{
|
||||||
window_item_remove(window, item);
|
WINDOW_REC *window;
|
||||||
|
|
||||||
|
window = window_item_window(item);
|
||||||
|
window_item_remove(item);
|
||||||
|
|
||||||
signal_emit("window item destroy", 2, window, item);
|
signal_emit("window item destroy", 2, window, item);
|
||||||
}
|
}
|
||||||
@ -103,7 +109,7 @@ void window_item_set_active(WINDOW_REC *window, WI_ITEM_REC *item)
|
|||||||
|
|
||||||
if (item != NULL && window_item_window(item) != window) {
|
if (item != NULL && window_item_window(item) != window) {
|
||||||
/* move item to different window */
|
/* move item to different window */
|
||||||
window_item_remove(window_item_window(item), item);
|
window_item_remove(item);
|
||||||
window_item_add(window, item, FALSE);
|
window_item_add(window, item, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
/* Add/remove/destroy window item from `window' */
|
/* Add/remove/destroy window item from `window' */
|
||||||
void window_item_add(WINDOW_REC *window, WI_ITEM_REC *item, int automatic);
|
void window_item_add(WINDOW_REC *window, WI_ITEM_REC *item, int automatic);
|
||||||
void window_item_remove(WINDOW_REC *window, WI_ITEM_REC *item);
|
void window_item_remove(WI_ITEM_REC *item);
|
||||||
void window_item_destroy(WINDOW_REC *window, WI_ITEM_REC *item);
|
void window_item_destroy(WI_ITEM_REC *item);
|
||||||
|
|
||||||
/* Find a window for `item' and call window_item_add(). */
|
/* Find a window for `item' and call window_item_add(). */
|
||||||
void window_item_create(WI_ITEM_REC *item, int automatic);
|
void window_item_create(WI_ITEM_REC *item, int automatic);
|
||||||
|
Loading…
Reference in New Issue
Block a user