diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-06-13 19:57:59 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-06-13 19:57:59 +0200 |
commit | d686dc547c436ccba28cbbce50ecf50c7a61abe0 (patch) | |
tree | 9120e43e4814d15e17b1c45aa8a44b6b38a6b3d0 | |
parent | 8a696d26e249650fb1f187c09112bd9133f37641 (diff) | |
download | weechat-d686dc547c436ccba28cbbce50ecf50c7a61abe0.zip |
Remove all merged buffers from hotlist, instead of only current selected buffer
-rw-r--r-- | src/gui/gui-hotlist.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c index 2d8cf38fb..4e84c3420 100644 --- a/src/gui/gui-hotlist.c +++ b/src/gui/gui-hotlist.c @@ -395,14 +395,27 @@ gui_hotlist_clear () void gui_hotlist_remove_buffer (struct t_gui_buffer *buffer) { - struct t_gui_hotlist *pos_hotlist; + int hotlist_changed; + struct t_gui_hotlist *ptr_hotlist, *next_hotlist; + + hotlist_changed = 0; - pos_hotlist = gui_hotlist_search (gui_hotlist, buffer); - if (pos_hotlist) + ptr_hotlist = gui_hotlist; + while (ptr_hotlist) { - gui_hotlist_free (&gui_hotlist, &last_gui_hotlist, pos_hotlist); - gui_hotlist_changed_signal (); + next_hotlist = ptr_hotlist->next_hotlist; + + if (ptr_hotlist->buffer->number == buffer->number) + { + gui_hotlist_free (&gui_hotlist, &last_gui_hotlist, ptr_hotlist); + hotlist_changed = 1; + } + + ptr_hotlist = next_hotlist; } + + if (hotlist_changed) + gui_hotlist_changed_signal (); } /* |