From bfad1975223ff5da6e998f3ad20fdc52e0fe94ca Mon Sep 17 00:00:00 2001 From: zhuyaliang <15132211195@163.com> Date: Fri, 14 Apr 2023 18:04:04 +0800 Subject: action: Delete unused sort_by_entries code --- src/actions.c | 9 --------- src/actions.h | 1 - src/fr-window.c | 29 ----------------------------- src/fr-window.h | 3 --- src/ui.h | 26 -------------------------- 5 files changed, 68 deletions(-) diff --git a/src/actions.c b/src/actions.c index 6b0b25c..5b749a8 100644 --- a/src/actions.c +++ b/src/actions.c @@ -747,15 +747,6 @@ activate_action_reload (GtkAction *action, fr_window_archive_reload (window); } -void -activate_action_sort_reverse_order (GtkAction *action, - gpointer data) -{ - FrWindow *window = data; - - fr_window_set_sort_type (window, gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)) ? GTK_SORT_DESCENDING : GTK_SORT_ASCENDING); -} - void activate_action_last_output (GtkAction *action, gpointer data) diff --git a/src/actions.h b/src/actions.h index f893503..41ab4b6 100644 --- a/src/actions.h +++ b/src/actions.h @@ -67,7 +67,6 @@ void activate_action_view_statusbar (GtkAction *action, gpointer data); void activate_action_view_folders (GtkAction *action, gpointer data); void activate_action_stop (GtkAction *action, gpointer data); void activate_action_reload (GtkAction *action, gpointer data); -void activate_action_sort_reverse_order (GtkAction *action, gpointer data); void activate_action_last_output (GtkAction *action, gpointer data); void activate_action_go_back (GtkAction *action, gpointer data); diff --git a/src/fr-window.c b/src/fr-window.c index 88d8d9a..665670d 100644 --- a/src/fr-window.c +++ b/src/fr-window.c @@ -4854,9 +4854,6 @@ sort_column_changed_cb (GtkTreeSortable *sortable, window->priv->sort_method = get_sort_method_from_column (column_id); window->priv->sort_type = order; - - /*set_active (window, get_action_from_sort_method (window->priv->sort_method), TRUE); - set_active (window, "SortReverseOrder", (window->priv->sort_type == GTK_SORT_DESCENDING));*/ } static gboolean @@ -5115,18 +5112,6 @@ view_as_radio_action (GtkAction *action, fr_window_set_list_mode (window, gtk_radio_action_get_current_value (current)); } -static void -sort_by_radio_action (GtkAction *action, - GtkRadioAction *current, - gpointer data) -{ - FrWindow *window = data; - - window->priv->sort_method = gtk_radio_action_get_current_value (current); - window->priv->sort_type = GTK_SORT_ASCENDING; - fr_window_update_list_order (window); -} - static void recent_chooser_item_activated_cb (GtkRecentChooser *chooser, FrWindow *window) @@ -5727,12 +5712,6 @@ fr_window_construct (FrWindow *window) window->priv->list_mode, G_CALLBACK (view_as_radio_action), window); - gtk_action_group_add_radio_actions (actions, - sort_by_entries, - n_sort_by_entries, - window->priv->sort_type, - G_CALLBACK (sort_by_radio_action), - window); g_signal_connect (ui, "connect_proxy", G_CALLBACK (connect_proxy_cb), window); @@ -7023,14 +7002,6 @@ fr_window_unselect_all (FrWindow *window) gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (window->priv->list_view))); } -void -fr_window_set_sort_type (FrWindow *window, - GtkSortType sort_type) -{ - window->priv->sort_type = sort_type; - fr_window_update_list_order (window); -} - void fr_window_stop (FrWindow *window) { diff --git a/src/fr-window.h b/src/fr-window.h index 9b006a9..436dd3c 100644 --- a/src/fr-window.h +++ b/src/fr-window.h @@ -217,9 +217,6 @@ GtkTreeModel * void fr_window_find (FrWindow *window); void fr_window_select_all (FrWindow *window); void fr_window_unselect_all (FrWindow *window); -void fr_window_set_sort_type (FrWindow *window, - GtkSortType sort_type); - /**/ void fr_window_rename_selection (FrWindow *window, diff --git a/src/ui.h b/src/ui.h index aef6b7e..ce77575 100644 --- a/src/ui.h +++ b/src/ui.h @@ -220,11 +220,6 @@ static GtkToggleActionEntry action_toggle_entries[] = { N_("View the statusbar"), G_CALLBACK (activate_action_view_statusbar), TRUE }, - { "SortReverseOrder", NULL, - N_("_Reversed Order"), NULL, - N_("Reverse the list order"), - G_CALLBACK (activate_action_sort_reverse_order), - FALSE }, { "ViewFolders", NULL, N_("_Folders"), "F9", N_("View the folders pane"), @@ -243,25 +238,4 @@ static GtkRadioActionEntry view_as_entries[] = { }; static guint n_view_as_entries = G_N_ELEMENTS (view_as_entries); -static GtkRadioActionEntry sort_by_entries[] = { - { "SortByName", NULL, - N_("by _Name"), NULL, - N_("Sort file list by name"), FR_WINDOW_SORT_BY_NAME }, - { "SortBySize", NULL, - N_("by _Size"), NULL, - N_("Sort file list by file size"), FR_WINDOW_SORT_BY_SIZE }, - { "SortByType", NULL, - N_("by T_ype"), NULL, - N_("Sort file list by type"), FR_WINDOW_SORT_BY_TYPE }, - { "SortByDate", NULL, - N_("by _Date Modified"), NULL, - N_("Sort file list by modification time"), FR_WINDOW_SORT_BY_TIME }, - { "SortByLocation", NULL, - /* Translators: this is the "sort by file location" menu item */ - N_("by _Location"), NULL, - /* Translators: location is the file location */ - N_("Sort file list by location"), FR_WINDOW_SORT_BY_PATH }, -}; -static guint n_sort_by_entries = G_N_ELEMENTS (sort_by_entries); - #endif /* UI_H */ -- cgit v1.2.1