chore(clang-tidy): modernize the code

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2026-05-11 23:16:39 +03:00
parent 18f04b1e29
commit 9c88eb9bc0
No known key found for this signature in database
GPG key ID: 55EF5DA53DB36318
36 changed files with 713 additions and 632 deletions

View file

@ -22,7 +22,7 @@ ModModel::ModModel(BaseInstance& base_inst, ResourceAPI* api, QString debugName,
ResourceAPI::SearchArgs ModModel::createSearchArguments()
{
auto profile = static_cast<MinecraftInstance const&>(m_base_instance).getPackProfile();
auto profile = static_cast<const MinecraftInstance&>(m_base_instance).getPackProfile();
Q_ASSERT(profile);
Q_ASSERT(m_filter);
@ -50,7 +50,7 @@ ResourceAPI::SearchArgs ModModel::createSearchArguments()
ResourceAPI::VersionSearchArgs ModModel::createVersionsArguments(const QModelIndex& entry)
{
auto pack = m_packs[entry.row()];
auto profile = static_cast<MinecraftInstance const&>(m_base_instance).getPackProfile();
auto profile = static_cast<const MinecraftInstance&>(m_base_instance).getPackProfile();
Q_ASSERT(profile);
Q_ASSERT(m_filter);
@ -88,7 +88,7 @@ bool ModModel::isPackInstalled(ModPlatform::IndexedPack::Ptr pack) const
auto allMods = static_cast<MinecraftInstance&>(m_base_instance).loaderModList()->allMods();
return std::any_of(allMods.cbegin(), allMods.cend(), [pack](Mod* mod) {
if (auto meta = mod->metadata(); meta)
return meta->provider == pack->provider && meta->project_id == pack->addonId;
return meta->provider == pack->provider && meta->projectId == pack->addonId;
return false;
});
}
@ -97,7 +97,7 @@ QVariant ModModel::getInstalledPackVersion(ModPlatform::IndexedPack::Ptr pack) c
{
auto allMods = static_cast<MinecraftInstance&>(m_base_instance).loaderModList()->allMods();
for (auto mod : allMods) {
if (auto meta = mod->metadata(); meta && meta->provider == pack->provider && meta->project_id == pack->addonId) {
if (auto meta = mod->metadata(); meta && meta->provider == pack->provider && meta->projectId == pack->addonId) {
return meta->version();
}
}