Added mcVersion column

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97
2023-10-17 19:25:01 +03:00
parent 9001d9eb75
commit b54376062e
11 changed files with 67 additions and 24 deletions

View File

@ -124,6 +124,14 @@ std::pair<int, bool> Mod::compare(const Resource& other, SortType type) const
return { -1, type == SortType::LOADERS };
break;
}
case SortType::MC_VERSIONS: {
auto thisVersion = mcVersions().join(",");
auto otherVersion = cast_other->mcVersions().join(",");
auto compare_result = QString::compare(thisVersion, otherVersion, Qt::CaseInsensitive);
if (compare_result != 0)
return { compare_result, type == SortType::MC_VERSIONS };
break;
}
}
return { 0, false };
}
@ -261,6 +269,13 @@ auto Mod::loaders() const -> ModPlatform::ModLoaderTypes
return {};
}
auto Mod::mcVersions() const -> QStringList
{
if (metadata())
return metadata()->mcVersions;
return {};
}
auto Mod::licenses() const -> const QList<ModLicense>&
{
return details().licenses;