Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sort by date without obeying folder/files #1369

Closed
wants to merge 2 commits into from
Closed

Conversation

tobiasKaminsky
Copy link
Contributor

ref: #1334

@tobiasKaminsky
Copy link
Contributor Author

sort

@tobiasKaminsky
Copy link
Contributor Author

@AndyScherzinger @davivel @przybylski please review

} else if (o2.isFolder()) {
return 1;
} else if (o1.getModificationTimestamp() == 0 || o2.getModificationTimestamp() == 0){
if (o1.getModificationTimestamp() == 0 || o2.getModificationTimestamp() == 0){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like that if there is no timestamp we artificially making it equal with everything. This leads to unexpected behavior when we do have multiple zeros in collection.
I would rather not take any special care of this and boil down compare method to something like this:

public int compare(OCFile o1, OCFile o2) {
    return val * (o1.getModificationTimestamp() - o2.getModificationTimestamp());
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but this is already the current behaviour.
So, we should discuss this in another issue?
(Although I do not know how often this problem might occur as the modification timestamp should always be set, or?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case its ok for me to be merged

@jesmrec jesmrec added this to the 2.12.0 milestone Jun 26, 2019
@jesmrec jesmrec modified the milestones: 2.12.0, 2.13.0 Jul 30, 2019
@jesmrec jesmrec modified the milestones: 2.13.0, 2.14.0 Aug 27, 2019
@abelgardep
Copy link
Contributor

To be done in #2710

@abelgardep abelgardep closed this Nov 11, 2019
@abelgardep abelgardep deleted the sortByDateMix branch November 11, 2019 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants