refactor+fix: Make FTB install task similar to other install tasks

In particular, this changes the order so that the instance gets created
before downloading the mods (like other install tasks), and the mod download
directly puts the files in the staging folder (like the others), instead
of that weird makeCached and copy stuff.

This fixes some issues with modpack downloads from FTB, like creating an
instance with no mods in it.

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow 2022-10-13 13:27:52 -03:00
parent 19ee736e1d
commit 83654a193e
No known key found for this signature in database
GPG key ID: 8D0F221F0A59F469
2 changed files with 64 additions and 87 deletions

View file

@ -56,7 +56,6 @@ public:
explicit PackInstallTask(Modpack pack, QString version, QWidget* parent = nullptr);
~PackInstallTask() override = default;
bool canAbort() const override { return m_abortable; }
bool abort() override;
protected:
@ -65,20 +64,20 @@ protected:
private slots:
void onManifestDownloadSucceeded();
void onResolveModsSucceeded();
void onCreateInstanceSucceeded();
void onModDownloadSucceeded();
void onManifestDownloadFailed(QString reason);
void onResolveModsFailed(QString reason);
void onCreateInstanceFailed(QString reason);
void onModDownloadFailed(QString reason);
private:
void resolveMods();
void createInstance();
void downloadPack();
void install();
private:
bool m_abortable = true;
NetJob::Ptr m_net_job = nullptr;
shared_qobject_ptr<Flame::FileResolvingTask> m_mod_id_resolver_task = nullptr;