talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 0bb007721f5a1fb10b9491fb6c1a7921fc3cec22
parent 0c28ce4c371ae2132cc5b83e418ff36541f3b5ec
Author: Paul <paul@claws-mail.org>
Date:   Sat,  9 Jun 2018 12:12:32 +0100

fix bug where 'sort_type' is lost when changing 'sort_key' from /View/sort

the bug was apparent with a descending sort. changing the sort_key
always set it to ascending

Diffstat:
Msrc/mainwindow.c | 11++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/mainwindow.c b/src/mainwindow.c @@ -4651,29 +4651,26 @@ static void set_folder_display_item_cb(GtkAction *action, gpointer data) static void sort_summary_cb(GtkAction *action, GtkRadioAction *current, gpointer data) { MainWindow *mainwin = (MainWindow *)data; - FolderItem *item = mainwin->summaryview->folder_item; gint value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (current)); if (mainwin->menu_lock_count) return; - if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current)) && item) { + if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current))) { summary_sort(mainwin->summaryview, (FolderSortKey)value, - item->sort_type); - item->sort_key = value; + mainwin->summaryview->sort_type); } } static void sort_summary_type_cb(GtkAction *gaction, GtkRadioAction *current, gpointer data) { MainWindow *mainwin = (MainWindow *)data; - FolderItem *item = mainwin->summaryview->folder_item; gint value = gtk_radio_action_get_current_value (GTK_RADIO_ACTION (current)); if (mainwin->menu_lock_count) return; - if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current)) && item) + if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (current))) summary_sort(mainwin->summaryview, - item->sort_key, (FolderSortType)value); + mainwin->summaryview->sort_key, (FolderSortType)value); } static void attract_by_subject_cb(GtkAction *action, gpointer data)