From d686dc547c436ccba28cbbce50ecf50c7a61abe0 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 13 Jun 2009 19:57:59 +0200 Subject: Remove all merged buffers from hotlist, instead of only current selected buffer --- src/gui/gui-hotlist.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src') 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 (); } /* -- cgit v1.2.3