diff options
author | flow <flowlnlnln@gmail.com> | 2022-11-25 09:23:46 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2023-01-13 16:23:00 -0300 |
commit | 6a1807995390b2a2cbe074ee1f47d3791e0e3f10 (patch) | |
tree | 592c7ea5be22577d4034668177119271c2218527 /launcher/ui/dialogs/ChooseProviderDialog.h | |
parent | b937d334362c0810ab59b3bc4660a2bbea31c7da (diff) | |
download | PrismLauncher-6a1807995390b2a2cbe074ee1f47d3791e0e3f10.tar.gz PrismLauncher-6a1807995390b2a2cbe074ee1f47d3791e0e3f10.tar.bz2 PrismLauncher-6a1807995390b2a2cbe074ee1f47d3791e0e3f10.zip |
refactor: generalize mod models and APIs to resources
Firstly, this abstract away behavior in the mod download models that can
also be applied to other types of resources into a superclass, allowing
other resource types to be implemented without so much code duplication.
For that, this also generalizes the APIs used (currently, ModrinthAPI
and FlameAPI) to be able to make requests to other types of resources.
It also does a general cleanup of both of those. In particular, this
makes use of std::optional instead of invalid values for errors and,
well, optional values :p
This is a squash of some commits that were becoming too interlaced
together to be cleanly separated.
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/ui/dialogs/ChooseProviderDialog.h')
-rw-r--r-- | launcher/ui/dialogs/ChooseProviderDialog.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/launcher/ui/dialogs/ChooseProviderDialog.h b/launcher/ui/dialogs/ChooseProviderDialog.h index 4a3b9f29..be9735b5 100644 --- a/launcher/ui/dialogs/ChooseProviderDialog.h +++ b/launcher/ui/dialogs/ChooseProviderDialog.h @@ -8,7 +8,7 @@ class ChooseProviderDialog; } namespace ModPlatform { -enum class Provider; +enum class ResourceProvider; } class Mod; @@ -24,7 +24,7 @@ class ChooseProviderDialog : public QDialog { bool try_others = false; - ModPlatform::Provider chosen; + ModPlatform::ResourceProvider chosen; }; public: @@ -45,7 +45,7 @@ class ChooseProviderDialog : public QDialog { void addProviders(); void disableInput(); - auto getSelectedProvider() const -> ModPlatform::Provider; + auto getSelectedProvider() const -> ModPlatform::ResourceProvider; private: Ui::ChooseProviderDialog* ui; |