After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 89706 - Should be able to sort by "when file was binned" in Trash folder
Should be able to sort by "when file was binned" in Trash folder
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Trash
2.16.x
Other Linux
: Normal enhancement
: 3.0
Assigned To: Nautilus Maintainers
Nautilus Maintainers
: 368251 408997 562156 584996 601716 626557 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2002-08-02 14:50 UTC by Hakon
Modified: 2010-08-11 01:07 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Adds "Deleted On" and "Original Path" as column options (9.55 KB, patch)
2009-09-14 18:41 UTC, Marcus Carlson
none Details | Review
Screenshot of trash with new columns (130.75 KB, image/png)
2009-09-14 18:53 UTC, Marcus Carlson
  Details
Updated patch to allow arrange by deletion date in icon view (11.38 KB, patch)
2009-09-15 18:47 UTC, Marcus Carlson
none Details | Review
Updated patch to only show the parent folder of the item removed (12.22 KB, patch)
2009-09-19 10:29 UTC, Marcus Carlson
needs-work Details | Review
Updated screenshot (138.00 KB, image/png)
2009-09-19 10:31 UTC, Marcus Carlson
  Details
Adds Trashed On and Original Location as columns in List View and option to sort by Trash Time in Icon View. (13.54 KB, patch)
2009-10-10 23:02 UTC, Marcus Carlson
needs-work Details | Review
patch that was committed (27.30 KB, patch)
2010-05-13 10:34 UTC, Cosimo Cecchi
committed Details | Review

Description Hakon 2002-08-02 14:50:13 UTC
MS Windows has a special sort-rule for files in the Trash bin, which is
"sort by date of when file was binned".
I would find that more useful than "sort by file creation date" when in the
Trash bin.
I'm not saying that the current option should go away in favour for this
suggestion, but it would be a nice complement.
Comment 1 Sebastien Bacher 2003-11-25 20:17:01 UTC
I'm changing the component to "Trash" since this bug is about the
trash view.
Comment 2 Teppo Turtiainen 2007-01-19 20:29:13 UTC
*** Bug 368251 has been marked as a duplicate of this bug. ***
Comment 3 Cosimo Cecchi 2007-12-26 23:26:49 UTC
*** Bug 408997 has been marked as a duplicate of this bug. ***
Comment 4 antistress 2007-12-27 10:26:04 UTC
if the bin had this ability to "sort by date of when file was binned", we could have a "Trash Autopurge" functionnality in GNOME (most applications propose such a functionnality : i.e. my webmail let me configure it to automatically delete messages in the trash after 7 days)
see my comments under Bug 408997
Comment 5 antistress 2008-02-02 17:23:42 UTC
i'm not a developper and i'm not sure to understand the role of GVFS but could the integration og GVFS in GNOME 2.22 be helpful to that bug report ?
Comment 6 antistress 2008-04-20 20:19:02 UTC
here is a great mockup of what could be done http://jeff.ecchi.ca/blog/images/trash-individual-files-expiry.png
Comment 7 antistress 2008-04-20 22:22:45 UTC
(the above mockup is from that article : I Don’t Want to Care About Trash http://jeff.ecchi.ca/blog/?p=335 )
Comment 8 A. Walton 2008-12-30 15:50:50 UTC
*** Bug 562156 has been marked as a duplicate of this bug. ***
Comment 9 Matijs van Zuijlen 2009-04-29 17:23:40 UTC
I've created a plugin that provides this functionality. One caveat: The column added by this plugin is a simple string, so in order to have good sorting the date format is not particularly user-friendly.

See http://github.com/mvz/nautilus-trash-date-deleted/tree/master
Comment 10 A. Walton 2009-06-06 16:33:48 UTC
*** Bug 584996 has been marked as a duplicate of this bug. ***
Comment 11 Holger Berndt 2009-07-12 22:21:38 UTC
I've had a shot at this, too. The proof-of-concept code is a Python standalone script that displays (and monitors, while it is running) the trash. In addition to showing the deleted-date, it also shows the original location, and lets one sort by them.

But, more importantly, it also provides views on the files deleted on a certain day (today, yesterday, 2 days ago etc). Personally, that helps me a lot while inspecting a messy trash.

Screenshot: http://img10.imageshack.us/img10/5161/bildschirmfoto1t.png
Code: http://github.com/hb/trashjournal/tree/master
Comment 12 Marcus Carlson 2009-09-14 18:41:21 UTC
Created attachment 143179 [details] [review]
Adds "Deleted On" and "Original Path" as column options

This initial patch adds "Deleted On" and "Original Path" as column options.

Need comment on the labeling and description of the columns (and implementation).

Needs review.
Comment 13 Marcus Carlson 2009-09-14 18:53:44 UTC
Created attachment 143180 [details]
Screenshot of trash with new columns
Comment 14 antistress 2009-09-14 22:51:48 UTC
that looks great !
Will it be possible to also have the initial feature requested (=having the contextual menu entry to sort files by deletion date) which can be useful in icon view mode ?
Comment 15 Marcus Carlson 2009-09-15 06:09:23 UTC
antistress, I'll see what I can do.
Comment 16 Marcus Carlson 2009-09-15 18:47:46 UTC
Created attachment 143244 [details] [review]
Updated patch to allow arrange by deletion date in icon view
Comment 17 Matijs van Zuijlen 2009-09-19 09:41:01 UTC
That looks very good. How about leaving the actual file name off the Original Path? Leaving it on seems kind of redundant, and leaving it off to me makes it more clear at a glance where the file came from.
Comment 18 Marcus Carlson 2009-09-19 10:29:37 UTC
Created attachment 143483 [details] [review]
Updated patch to only show the parent folder of the item removed

Matijs, like this?
Comment 19 Marcus Carlson 2009-09-19 10:31:22 UTC
Created attachment 143484 [details]
Updated screenshot
Comment 20 Matijs van Zuijlen 2009-09-19 11:51:32 UTC
Marcus, that was quick!
Yes, that looks very good.
Thanks!
Comment 21 Philip Hachey 2009-09-20 00:24:55 UTC
I concur.  This is perfect.  Thank you!  I vote that this be incorporated into the earliest possible release.
Comment 22 antistress 2009-09-21 23:47:52 UTC
looks wonderful :-)
Comment 23 Alexander Larsson 2009-10-06 12:53:48 UTC
+     "label", _("Deleted On"),

=> Trashed On

+    "description", _("When file was moved to Trash"),

"Date when the file was move to the Trash"

+  { "Sort by Deletion Date", NULL,
+    N_("By _Deletion Date"), NULL,
+    N_("Keep icons sorted by deletion date in rows"),
+    NAUTILUS_FILE_SORT_BY_TRASHED_TIME },

+ <menuitem name="Sort by Deletion Date" action="Sort by Deletion Date"/>

Sort by trash time, etc.

+					       "label", _("Original Path"),
+					       "description", _("Original path of file before moved to Trash"),

Path => Location, as this conceptually can be a non-path (although not implementation-wise atm)

+		return g_uri_unescape_string (file->details->trash_orig_path, "");

This should use g_file_from_filename(orig_path) then g_file_get_parse_name()

+	char *trash_orig_path_parent;
No need to waste one pointer per NautilusFile for this, just compute when needed.

+	if (trash_time && file->details->trash_time != trash_time) {
Surely if trash_time is now zero we should still change the file trash time?
Comment 24 Marcus Carlson 2009-10-10 23:02:19 UTC
Created attachment 145231 [details] [review]
Adds Trashed On and Original Location as columns in List View and option to sort by Trash Time in Icon View.
Comment 25 A. Walton 2009-11-13 15:15:05 UTC
*** Bug 601716 has been marked as a duplicate of this bug. ***
Comment 26 Alexander Larsson 2010-04-07 07:48:35 UTC
Review of attachment 145231 [details] [review]:

::: libnautilus-private/nautilus-file.c
@@ +2022,3 @@
 	int sort_order;
 	time_t atime, mtime, ctime;
+	time_t trash_time = 0;

Initialization at declaration not allowed by nautilus coding style.

@@ +4556,3 @@
+		location = nautilus_file_get_location (parent);
+		filename = g_file_get_parse_name (location);
+		return filename;

This leaks orig_file, parent and location
Comment 27 Cosimo Cecchi 2010-05-12 17:54:45 UTC
I improved this original patch by showing these new columns by default in the trash, and in the meantime, hiding them from the column chooser when it's used in other locations (or from the preferences).

I will attach an updated patch soon.
Comment 28 Cosimo Cecchi 2010-05-13 10:34:17 UTC
Created attachment 160963 [details] [review]
patch that was committed
Comment 29 Cosimo Cecchi 2010-05-13 10:35:45 UTC
I pushed this updated patch to master, which also takes care of automatically enabling/disabling trash columns and 'arrange by trash time' options in list and icon view according to the current location.

Closing as FIXED.
Comment 30 antistress 2010-05-23 08:36:38 UTC
Thanks for adding this useful functionality

As i wrote in comment #4, it would be cool to also have a "Trash autopurge" functionality (like webmails). I've filled Bug 619408 for that
Comment 31 A. Walton 2010-08-11 01:07:55 UTC
*** Bug 626557 has been marked as a duplicate of this bug. ***