diff options
author | Alexandru Ionut Tripon <alexandru.tripon97@gmail.com> | 2023-06-03 00:04:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-02 18:04:06 -0300 |
commit | 1840505a0f887ebfc2c719113873ea3345b133fb (patch) | |
tree | 9ac0105dcb21be1353813b558b3eac8c717f6f1a /launcher/ui/dialogs/ResourceDownloadDialog.h | |
parent | 0ece0b5b2796bded331d30988ee42258456703af (diff) | |
download | PrismLauncher-1840505a0f887ebfc2c719113873ea3345b133fb.tar.gz PrismLauncher-1840505a0f887ebfc2c719113873ea3345b133fb.tar.bz2 PrismLauncher-1840505a0f887ebfc2c719113873ea3345b133fb.zip |
Fix crash when selecting same mod from different providers (#1029)
Diffstat (limited to 'launcher/ui/dialogs/ResourceDownloadDialog.h')
-rw-r--r-- | launcher/ui/dialogs/ResourceDownloadDialog.h | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/launcher/ui/dialogs/ResourceDownloadDialog.h b/launcher/ui/dialogs/ResourceDownloadDialog.h index 5678dc8b..5b5b48c6 100644 --- a/launcher/ui/dialogs/ResourceDownloadDialog.h +++ b/launcher/ui/dialogs/ResourceDownloadDialog.h @@ -62,8 +62,8 @@ class ResourceDownloadDialog : public QDialog, public BasePageProvider { bool selectPage(QString pageId); ResourcePage* getSelectedPage(); - void addResource(ModPlatform::IndexedPack&, ModPlatform::IndexedVersion&, bool is_indexed = false); - void removeResource(ModPlatform::IndexedPack&, ModPlatform::IndexedVersion&); + void addResource(ModPlatform::IndexedPack::Ptr, ModPlatform::IndexedVersion&); + void removeResource(const QString&); const QList<DownloadTaskPtr> getTasks(); [[nodiscard]] const std::shared_ptr<ResourceFolderModel> getBaseModel() const { return m_base_model; } @@ -79,6 +79,7 @@ class ResourceDownloadDialog : public QDialog, public BasePageProvider { protected: [[nodiscard]] virtual QString geometrySaveKey() const { return ""; } + void setButtonStatus(); protected: const std::shared_ptr<ResourceFolderModel> m_base_model; @@ -88,12 +89,8 @@ class ResourceDownloadDialog : public QDialog, public BasePageProvider { QDialogButtonBox m_buttons; QVBoxLayout m_vertical_layout; - - QHash<QString, DownloadTaskPtr> m_selected; }; - - class ModDownloadDialog final : public ResourceDownloadDialog { Q_OBJECT @@ -135,8 +132,8 @@ class TexturePackDownloadDialog final : public ResourceDownloadDialog { public: explicit TexturePackDownloadDialog(QWidget* parent, - const std::shared_ptr<TexturePackFolderModel>& resource_packs, - BaseInstance* instance); + const std::shared_ptr<TexturePackFolderModel>& resource_packs, + BaseInstance* instance); ~TexturePackDownloadDialog() override = default; //: String that gets appended to the texture pack download dialog title ("Download " + resourcesString()) @@ -153,9 +150,7 @@ class ShaderPackDownloadDialog final : public ResourceDownloadDialog { Q_OBJECT public: - explicit ShaderPackDownloadDialog(QWidget* parent, - const std::shared_ptr<ShaderPackFolderModel>& shader_packs, - BaseInstance* instance); + explicit ShaderPackDownloadDialog(QWidget* parent, const std::shared_ptr<ShaderPackFolderModel>& shader_packs, BaseInstance* instance); ~ShaderPackDownloadDialog() override = default; //: String that gets appended to the shader pack download dialog title ("Download " + resourcesString()) |