mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-07-02 03:16:58 +03:00
chore(clang-tidy): modernize the code
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
parent
18f04b1e29
commit
9c88eb9bc0
36 changed files with 713 additions and 632 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue