diff --git a/src/gui/gui-hotlist.c b/src/gui/gui-hotlist.c index 7964dce94..9d661ad57 100644 --- a/src/gui/gui-hotlist.c +++ b/src/gui/gui-hotlist.c @@ -546,20 +546,25 @@ void gui_hotlist_resort () { struct t_gui_hotlist *new_hotlist, *last_new_hotlist; - struct t_gui_hotlist *ptr_hotlist, *ptr_next_hotlist; + struct t_gui_hotlist *ptr_hotlist, *ptr_next_hotlist, *ptr_prev_hotlist; + int hotlist_changed; /* sort is not needed if hotlist has less than 2 entries */ if (!gui_hotlist || !gui_hotlist->next_hotlist) return; /* resort hotlist in new linked list */ + hotlist_changed = 0; new_hotlist = NULL; last_new_hotlist = NULL; ptr_hotlist = gui_hotlist; while (ptr_hotlist) { ptr_next_hotlist = ptr_hotlist->next_hotlist; + ptr_prev_hotlist = ptr_hotlist->prev_hotlist; gui_hotlist_add_hotlist (&new_hotlist, &last_new_hotlist, ptr_hotlist); + if (ptr_hotlist->prev_hotlist != ptr_prev_hotlist) + hotlist_changed = 1; ptr_hotlist = ptr_next_hotlist; } @@ -567,7 +572,8 @@ gui_hotlist_resort () gui_hotlist = new_hotlist; last_gui_hotlist = last_new_hotlist; - gui_hotlist_changed_signal (NULL); + if (hotlist_changed) + gui_hotlist_changed_signal (NULL); } /*