update java sorting by taking into consideration release time
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
7a42fb284a
commit
f6a7fc215a
@ -83,6 +83,13 @@ bool Metadata::operator<(const Metadata& rhs)
|
||||
if (id > rhs.version) {
|
||||
return false;
|
||||
}
|
||||
auto date = releaseTime;
|
||||
if (date < rhs.releaseTime) {
|
||||
return true;
|
||||
}
|
||||
if (date > rhs.releaseTime) {
|
||||
return false;
|
||||
}
|
||||
return StringUtils::naturalCompare(m_name, rhs.m_name, Qt::CaseInsensitive) < 0;
|
||||
}
|
||||
|
||||
|
@ -59,12 +59,6 @@ bool JavaVersion::operator<(const JavaVersion& rhs)
|
||||
auto major = m_major;
|
||||
auto rmajor = rhs.m_major;
|
||||
|
||||
// HACK: discourage using java 9
|
||||
if (major > 8)
|
||||
major = -major;
|
||||
if (rmajor > 8)
|
||||
rmajor = -rmajor;
|
||||
|
||||
if (major < rmajor)
|
||||
return true;
|
||||
if (major > rmajor)
|
||||
|
Loading…
Reference in New Issue
Block a user