diff options
author | flow <flowlnlnln@gmail.com> | 2022-08-11 18:24:26 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-08-20 10:48:00 -0300 |
commit | 92aa24ae345c7b50028ea672c0d175d87e906c59 (patch) | |
tree | b67fa48e2f542fcb7f134da7b39c3b42a62ce1bd /launcher/ui | |
parent | 97a74d5c1f00a11d331a41b16690f7202fe102a3 (diff) | |
download | PrismLauncher-92aa24ae345c7b50028ea672c0d175d87e906c59.tar.gz PrismLauncher-92aa24ae345c7b50028ea672c0d175d87e906c59.tar.bz2 PrismLauncher-92aa24ae345c7b50028ea672c0d175d87e906c59.zip |
fix: don't give shared pointer to obj. external to the model
It causes some weird problems and adds refcounting overhead.
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/ui')
-rw-r--r-- | launcher/ui/dialogs/ModUpdateDialog.cpp | 9 | ||||
-rw-r--r-- | launcher/ui/dialogs/ModUpdateDialog.h | 4 |
2 files changed, 6 insertions, 7 deletions
diff --git a/launcher/ui/dialogs/ModUpdateDialog.cpp b/launcher/ui/dialogs/ModUpdateDialog.cpp index d73c8ebb..a91f6e5c 100644 --- a/launcher/ui/dialogs/ModUpdateDialog.cpp +++ b/launcher/ui/dialogs/ModUpdateDialog.cpp @@ -36,7 +36,7 @@ static ModAPI::ModLoaderTypes mcLoaders(BaseInstance* inst) ModUpdateDialog::ModUpdateDialog(QWidget* parent, BaseInstance* instance, const std::shared_ptr<ModFolderModel> mods, - QList<Mod::Ptr>& search_for) + QList<Mod*>& search_for) : ReviewMessageBox(parent, tr("Confirm mods to update"), "") , m_parent(parent) , m_mod_model(mods) @@ -226,9 +226,8 @@ auto ModUpdateDialog::ensureMetadata() -> bool }; for (auto candidate : m_candidates) { - auto* candidate_ptr = candidate.get(); if (candidate->status() != ModStatus::NoMetadata) { - onMetadataEnsured(candidate_ptr); + onMetadataEnsured(candidate); continue; } @@ -236,7 +235,7 @@ auto ModUpdateDialog::ensureMetadata() -> bool continue; if (confirm_rest) { - addToTmp(candidate_ptr, provider_rest); + addToTmp(candidate, provider_rest); should_try_others.insert(candidate->internal_id(), try_others_rest); continue; } @@ -261,7 +260,7 @@ auto ModUpdateDialog::ensureMetadata() -> bool should_try_others.insert(candidate->internal_id(), response.try_others); if (confirmed) - addToTmp(candidate_ptr, response.chosen); + addToTmp(candidate, response.chosen); } if (!modrinth_tmp.empty()) { diff --git a/launcher/ui/dialogs/ModUpdateDialog.h b/launcher/ui/dialogs/ModUpdateDialog.h index 76aaab36..bd486f0d 100644 --- a/launcher/ui/dialogs/ModUpdateDialog.h +++ b/launcher/ui/dialogs/ModUpdateDialog.h @@ -19,7 +19,7 @@ class ModUpdateDialog final : public ReviewMessageBox { explicit ModUpdateDialog(QWidget* parent, BaseInstance* instance, const std::shared_ptr<ModFolderModel> mod_model, - QList<Mod::Ptr>& search_for); + QList<Mod*>& search_for); void checkCandidates(); @@ -46,7 +46,7 @@ class ModUpdateDialog final : public ReviewMessageBox { const std::shared_ptr<ModFolderModel> m_mod_model; - QList<Mod::Ptr>& m_candidates; + QList<Mod*>& m_candidates; QList<Mod*> m_modrinth_to_update; QList<Mod*> m_flame_to_update; |