GNOME Bugzilla – Bug 89706
Should be able to sort by "when file was binned" in Trash folder
Last modified: 2010-08-11 01:07:55 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.
I'm changing the component to "Trash" since this bug is about the trash view.
*** Bug 368251 has been marked as a duplicate of this bug. ***
*** Bug 408997 has been marked as a duplicate of this bug. ***
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
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 ?
here is a great mockup of what could be done http://jeff.ecchi.ca/blog/images/trash-individual-files-expiry.png
(the above mockup is from that article : I Don’t Want to Care About Trash http://jeff.ecchi.ca/blog/?p=335 )
*** Bug 562156 has been marked as a duplicate of this bug. ***
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
*** Bug 584996 has been marked as a duplicate of this bug. ***
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
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.
Created attachment 143180 [details] Screenshot of trash with new columns
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 ?
antistress, I'll see what I can do.
Created attachment 143244 [details] [review] Updated patch to allow arrange by deletion date in icon view
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.
Created attachment 143483 [details] [review] Updated patch to only show the parent folder of the item removed Matijs, like this?
Created attachment 143484 [details] Updated screenshot
Marcus, that was quick! Yes, that looks very good. Thanks!
I concur. This is perfect. Thank you! I vote that this be incorporated into the earliest possible release.
looks wonderful :-)
+ "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?
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.
*** Bug 601716 has been marked as a duplicate of this bug. ***
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
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.
Created attachment 160963 [details] [review] patch that was committed
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.
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
*** Bug 626557 has been marked as a duplicate of this bug. ***