Support "Deletion Date" role in Trash
ClosedPublic

Authored by broulik on Jun 19 2017, 10:27 AM.

Details

Summary

This allows to sort by and show (both as additional data in icon view and column in column view) deletion date of files in Trash.

CHANGELOG: It is now possible to view and sort by "Deletion Date" in Trash

BUG: 153492
FIXED-IN: 17.08.0

Test Plan

Added "Deletion Date" as column in my Trash and it worked and I could sort by it by clicking the column header. Additional info also shows it in the view.

It doesn't store the enum values anywhere (.directory file), I hope, as I added a value inbetween.


(The column is not enabled by default but can be added by the user)

I didn't find any other KIO besides trash that uses Extra Fields so I didn't bother rewriting all the things to generically support this feature ;)

Diff Detail

Repository
R318 Dolphin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Jun 19 2017, 10:27 AM
Restricted Application added a subscriber: Konqueror. · View Herald TranscriptJun 19 2017, 10:27 AM
broulik edited the test plan for this revision. (Show Details)Jun 19 2017, 10:29 AM
dfaure edited edge metadata.Jun 19 2017, 12:04 PM

Nice! Kai-Uwe, you rock ;)

I'll let the Dolphin people review the implementation, but this is a definite +1 from me, for finally implementing a very old feature request.

Thanks for the "trash KIO already does it, it's just Dolphin" nudge ;)

markg accepted this revision.EditedJun 19 2017, 3:23 PM
markg added a subscriber: markg.

A very big +2!
You can wait for Emanuel to chime in and give his opinion.
It seems a bit unlikely that he would chime in anytime soon though. His last mail in the KFM list (either by mail or by comment on reviewboard or here) is from Feb. 18. You can wait for him, but i think he would be fine with fine with the change.

This revision is now accepted and ready to land.Jun 19 2017, 3:23 PM
cfeck added a subscriber: cfeck.Jun 19 2017, 3:56 PM

Does trash:// KIO really only record the deletion date vs. the time?

Does trash:// KIO really only record the deletion date vs. the time?

It's a proper timestamp, it's just the naming I took from there. I was thinking of calling it deletiontime to be in with modificationtime and accesstime, I wouldn't mind either of them.

cfeck added a comment.Jun 19 2017, 4:14 PM

If trash KIO is already inconsistent we can indeed pick being inconsistent with either it or with the rest of Dolphin.

But I am concerned about the UI string.

emmanuelp requested changes to this revision.Jun 20 2017, 8:51 AM
emmanuelp added a subscriber: emmanuelp.
In D6269#117553, @cfeck wrote:

If trash KIO is already inconsistent we can indeed pick being inconsistent with either it or with the rest of Dolphin.

But I am concerned about the UI string.

I would also prefer Deletion Time over Deletion Date.

Otherwise +1

This revision now requires changes to proceed.Jun 20 2017, 8:51 AM

Special handling of DeletionDateRole is missing in:

  • KFileItemModel::sortRoleCompare (see ModificationTimeRole for an example)
  • KFileItemModel::groups -> requires that timeRoleGroups() uses the sort role instead of KFileItem::FileTimes

Otherwise the sorting and grouping by deletion date would be wrong/inconsistent.

broulik updated this revision to Diff 15626.Jun 20 2017, 9:15 AM
broulik edited edge metadata.

Rename to deletiontime to be consistent with modificationtime and accesstime

broulik updated this revision to Diff 15629.Jun 20 2017, 9:27 AM
  • Adjust sortRoleCompare
  • Adjust timeRoleGroups so it takes a lambda where we can then return the proper timestamp (either from KFileItem or a role)

I don't know what causes this, though :)

(also affects modifiedtime and is just this particular date, probably a translation error, as it's not in the English version)

emmanuelp accepted this revision as: Dolphin.Jun 20 2017, 9:31 AM
  • Adjust timeRoleGroups so it takes a lambda where we can then return the proper timestamp (either from KFileItem or a role)

Nice idea!

This revision was automatically updated to reflect the committed changes.