diff options
author | flow <thiagodonato300@gmail.com> | 2022-03-02 18:35:59 -0300 |
---|---|---|
committer | flow <thiagodonato300@gmail.com> | 2022-03-02 18:49:19 -0300 |
commit | 881b2f2b385f19d9b64a149fca3c3741a803a172 (patch) | |
tree | ff13eabfeec171560c2b8b90aa00db6a48e92691 /launcher/modplatform/flame/FlameModIndex.h | |
parent | ca211558b5a4ee8b0dec3471c92f952002216532 (diff) | |
download | PrismLauncher-881b2f2b385f19d9b64a149fca3c3741a803a172.tar.gz PrismLauncher-881b2f2b385f19d9b64a149fca3c3741a803a172.tar.bz2 PrismLauncher-881b2f2b385f19d9b64a149fca3c3741a803a172.zip |
refactor: Use a single indexed pack for mods
Since there's little difference between them, let's remove duplication
and merge them.
Diffstat (limited to 'launcher/modplatform/flame/FlameModIndex.h')
-rw-r--r-- | launcher/modplatform/flame/FlameModIndex.h | 48 |
1 files changed, 9 insertions, 39 deletions
diff --git a/launcher/modplatform/flame/FlameModIndex.h b/launcher/modplatform/flame/FlameModIndex.h index 0293bb23..34f71498 100644 --- a/launcher/modplatform/flame/FlameModIndex.h +++ b/launcher/modplatform/flame/FlameModIndex.h @@ -3,48 +3,18 @@ // #pragma once -#include <QList> -#include <QMetaType> -#include <QString> -#include <QVector> + +#include "modplatform/ModIndex.h" + #include <QNetworkAccessManager> -#include <QObjectPtr.h> -#include "net/NetJob.h" #include "BaseInstance.h" namespace FlameMod { - struct ModpackAuthor { - QString name; - QString url; - }; - - struct IndexedVersion { - int addonId; - int fileId; - QString version; - QVector<QString> mcVersion; - QString downloadUrl; - QString date; - QString fileName; - }; - - struct IndexedPack - { - int addonId; - QString name; - QString description; - QList<ModpackAuthor> authors; - QString logoName; - QString logoUrl; - QString websiteUrl; - - bool versionsLoaded = false; - QVector<IndexedVersion> versions; - }; - - void loadIndexedPack(IndexedPack & m, QJsonObject & obj); - void loadIndexedPackVersions(IndexedPack &pack, QJsonArray &arr, const shared_qobject_ptr<QNetworkAccessManager> &network, BaseInstance *inst); -} +void loadIndexedPack(ModPlatform::IndexedPack& m, QJsonObject& obj); +void loadIndexedPackVersions(ModPlatform::IndexedPack& pack, + QJsonArray& arr, + const shared_qobject_ptr<QNetworkAccessManager>& network, + BaseInstance* inst); -Q_DECLARE_METATYPE(FlameMod::IndexedPack) +} // namespace FlameMod |