From f60872ac2538fe47ffdab274bc0ddb8323ed950b Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Jul 01 2015 16:46:46 +0000 Subject: Backport patch to restore mtime sorting (GNOME #748185) --- diff --git a/0001-toolbar-show-modified-time-for-all-places-except-Rec.patch b/0001-toolbar-show-modified-time-for-all-places-except-Rec.patch new file mode 100644 index 0000000..8f7611b --- /dev/null +++ b/0001-toolbar-show-modified-time-for-all-places-except-Rec.patch @@ -0,0 +1,147 @@ +From 10ca6eed2a6ef80cae2a0649bfe682a6c02fed9f Mon Sep 17 00:00:00 2001 +From: Carlos Soriano +Date: Wed, 1 Jul 2015 16:27:29 +0200 +Subject: [PATCH] toolbar: show modified time for all places except Recent + +We changed to only show access time for sorting in the sort menu +in 3.16 to avoid having both sorting options always present. +But for folders like Downloads, the most useful sorting criteria is +actually modified time, since it orders the files in downloading order. +Actually modified time is more useful than access time is all cases +except in "Recent", which what we actually want is the most recent +accessed or modified file. + +For that, show only Modified Time sorting menu item in all places +except in "Recent", where we will show only Access Time. + +https://bugzilla.gnome.org/show_bug.cgi?id=748185 +--- + src/nautilus-canvas-view.c | 12 ++++++++++-- + src/nautilus-toolbar-view-menu.xml | 9 +++++++++ + src/nautilus-toolbar.c | 22 ++++++++++++++++------ + 3 files changed, 35 insertions(+), 8 deletions(-) + +diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c +index 543b713..922639b 100644 +--- a/src/nautilus-canvas-view.c ++++ b/src/nautilus-canvas-view.c +@@ -107,6 +107,12 @@ struct NautilusCanvasViewDetails + gboolean supports_keep_aligned; + }; + ++static gboolean ++file_is_not_in_recent (NautilusFile *file) ++{ ++ return !nautilus_file_is_in_recent (file); ++} ++ + /* Note that the first item in this list is the default sort, + * and that the items show up in the menu in the order they + * appear in this list. +@@ -130,12 +136,14 @@ static const SortCriterion sort_criteria[] = { + { + NAUTILUS_FILE_SORT_BY_MTIME, + "modification date", +- "modification-date" ++ "modification-date", ++ file_is_not_in_recent + }, + { + NAUTILUS_FILE_SORT_BY_ATIME, + "access date", +- "access-date" ++ "access-date", ++ nautilus_file_is_in_recent + }, + { + NAUTILUS_FILE_SORT_BY_TRASHED_TIME, +diff --git a/src/nautilus-toolbar-view-menu.xml b/src/nautilus-toolbar-view-menu.xml +index d1cb8b5..f2e0341 100644 +--- a/src/nautilus-toolbar-view-menu.xml ++++ b/src/nautilus-toolbar-view-menu.xml +@@ -132,6 +132,15 @@ + + + ++ ++ True ++ True ++ Last _Modified ++ view.sort ++ 'modification-date' ++ ++ ++ + + False + True +diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c +index 68bb86d..79697a7 100644 +--- a/src/nautilus-toolbar.c ++++ b/src/nautilus-toolbar.c +@@ -59,6 +59,8 @@ struct _NautilusToolbarPrivate { + + GtkWidget *view_menu_widget; + GtkWidget *sort_menu; ++ GtkWidget *sort_modification_date; ++ GtkWidget *sort_access_date; + GtkWidget *sort_trash_time; + GtkWidget *sort_search_relevance; + GtkWidget *visible_columns; +@@ -440,6 +442,8 @@ nautilus_toolbar_init (NautilusToolbar *self) + self->priv->zoom_adjustment = GTK_ADJUSTMENT (gtk_builder_get_object (builder, "zoom_adjustment")); + + self->priv->sort_menu = GTK_WIDGET (gtk_builder_get_object (builder, "sort_menu")); ++ self->priv->sort_modification_date = GTK_WIDGET (gtk_builder_get_object (builder, "sort_modification_date")); ++ self->priv->sort_access_date = GTK_WIDGET (gtk_builder_get_object (builder, "sort_access_date")); + self->priv->sort_trash_time = GTK_WIDGET (gtk_builder_get_object (builder, "sort_trash_time")); + self->priv->sort_search_relevance = GTK_WIDGET (gtk_builder_get_object (builder, "sort_search_relevance")); + self->priv->visible_columns = GTK_WIDGET (gtk_builder_get_object (builder, "visible_columns")); +@@ -575,7 +579,7 @@ nautilus_toolbar_reset_menus (NautilusToolbar *self) + GActionGroup *view_action_group; + GVariant *variant; + GVariantIter iter; +- gboolean sort_trash, sort_search, has_sort; ++ gboolean show_sort_trash, show_sort_search, show_sort_access, show_sort_modification, has_sort; + const gchar *hint; + + /* Allow actions from the current view to be activated through +@@ -591,7 +595,7 @@ nautilus_toolbar_reset_menus (NautilusToolbar *self) + g_action_group_has_action (view_action_group, "visible-columns")); + + has_sort = g_action_group_has_action (view_action_group, "sort"); +- sort_trash = sort_search = FALSE; ++ show_sort_trash = show_sort_search = show_sort_modification = show_sort_access = FALSE; + gtk_widget_set_visible (self->priv->sort_menu, has_sort); + + if (has_sort) { +@@ -600,16 +604,22 @@ nautilus_toolbar_reset_menus (NautilusToolbar *self) + + while (g_variant_iter_next (&iter, "&s", &hint)) { + if (g_strcmp0 (hint, "trash-time") == 0) +- sort_trash = TRUE; ++ show_sort_trash = TRUE; + if (g_strcmp0 (hint, "search-relevance") == 0) +- sort_search = TRUE; ++ show_sort_search = TRUE; ++ if (g_strcmp0 (hint, "access-date") == 0) ++ show_sort_access = TRUE; ++ if (g_strcmp0 (hint, "modification-date") == 0) ++ show_sort_modification = TRUE; + } + + g_variant_unref (variant); + } + +- gtk_widget_set_visible (self->priv->sort_trash_time, sort_trash); +- gtk_widget_set_visible (self->priv->sort_search_relevance, sort_search); ++ gtk_widget_set_visible (self->priv->sort_trash_time, show_sort_trash); ++ gtk_widget_set_visible (self->priv->sort_search_relevance, show_sort_search); ++ gtk_widget_set_visible (self->priv->sort_modification_date, show_sort_modification); ++ gtk_widget_set_visible (self->priv->sort_access_date, show_sort_access); + + variant = g_action_group_get_action_state (view_action_group, "zoom-to-level"); + gtk_adjustment_set_value (self->priv->zoom_adjustment, +-- +2.1.0 + diff --git a/nautilus.spec b/nautilus.spec index eec5aab..866f3a7 100644 --- a/nautilus.spec +++ b/nautilus.spec @@ -10,7 +10,7 @@ Name: nautilus Summary: File manager for GNOME Version: 3.16.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: User Interface/Desktops Source: https://download.gnome.org/sources/%{name}/3.16/%{name}-%{version}.tar.xz @@ -53,6 +53,9 @@ Provides: gnome-volume-manager = 2.24.0-2 Obsoletes: eel2 < 2.26.0-3 Provides: eel2 = 2.26.0-3 +# https://bugzilla.gnome.org/show_bug.cgi?id=748185 +Patch0: 0001-toolbar-show-modified-time-for-all-places-except-Rec.patch + # The selinux patch is here to not lose it, should go upstream and needs # cleaning up to work with current nautilus git. #Patch4: nautilus-2.91.8-selinux.patch @@ -89,6 +92,7 @@ for developing nautilus extensions. %prep %setup -q -n %{name}-%{version} +%patch0 -p1 -b .mtime #%%patch4 -p1 -b .selinux %build @@ -167,6 +171,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas >&/dev/null || : %doc %{_datadir}/gtk-doc/html/libnautilus-extension/ %changelog +* Wed Jul 01 2015 Debarshi Ray - 3.16.2-2 +- Backport patch to restore mtime sorting (GNOME #748185) + * Wed May 13 2015 Kalev Lember - 3.16.2-1 - Update to 3.16.2