2016-01-01 23:35:54 +00:00
|
|
|
#include "JavaInstall.h"
|
2022-11-03 19:41:55 +00:00
|
|
|
|
|
|
|
#include "StringUtils.h"
|
2016-01-01 23:35:54 +00:00
|
|
|
|
2023-07-14 11:31:13 +01:00
|
|
|
bool JavaInstall::operator<(const JavaInstall& rhs)
|
2016-01-01 23:35:54 +00:00
|
|
|
{
|
2022-11-03 19:41:55 +00:00
|
|
|
auto archCompare = StringUtils::naturalCompare(arch, rhs.arch, Qt::CaseInsensitive);
|
2023-07-14 11:31:13 +01:00
|
|
|
if (archCompare != 0)
|
2016-01-01 23:35:54 +00:00
|
|
|
return archCompare < 0;
|
2023-07-14 11:31:13 +01:00
|
|
|
if (id < rhs.id) {
|
2016-01-01 23:35:54 +00:00
|
|
|
return true;
|
|
|
|
}
|
2023-07-14 11:31:13 +01:00
|
|
|
if (id > rhs.id) {
|
2016-01-01 23:35:54 +00:00
|
|
|
return false;
|
|
|
|
}
|
2022-11-03 19:41:55 +00:00
|
|
|
return StringUtils::naturalCompare(path, rhs.path, Qt::CaseInsensitive) < 0;
|
2016-01-01 23:35:54 +00:00
|
|
|
}
|
|
|
|
|
2023-07-14 11:31:13 +01:00
|
|
|
bool JavaInstall::operator==(const JavaInstall& rhs)
|
2016-01-01 23:35:54 +00:00
|
|
|
{
|
|
|
|
return arch == rhs.arch && id == rhs.id && path == rhs.path;
|
|
|
|
}
|
|
|
|
|
2023-07-14 11:31:13 +01:00
|
|
|
bool JavaInstall::operator>(const JavaInstall& rhs)
|
2016-01-01 23:35:54 +00:00
|
|
|
{
|
|
|
|
return (!operator<(rhs)) && (!operator==(rhs));
|
|
|
|
}
|