feat+fix: allow forwarding extra info to InstanceImportTask

This allows us to pass to the creation instances their actual pack ID
and version ID, that in Flame's case, are only available before starting
to create an instance.

Signed-off-by: flow <flowlnlnln@gmail.com>
This commit is contained in:
flow
2022-11-12 11:42:07 -03:00
parent 7f5dea28bb
commit 968366c2ae
9 changed files with 56 additions and 33 deletions

View File

@ -56,7 +56,7 @@ class InstanceImportTask : public InstanceTask
{
Q_OBJECT
public:
explicit InstanceImportTask(const QUrl sourceUrl, QWidget* parent = nullptr);
explicit InstanceImportTask(const QUrl sourceUrl, QWidget* parent = nullptr, QMap<QString, QString> extra_info = {});
bool abort() override;
const QVector<Flame::File> &getBlockedFiles() const
@ -101,6 +101,10 @@ private: /* data */
Modrinth,
} m_modpackType = ModpackType::Unknown;
// Extra info we might need, that's available before, but can't be derived from
// the source URL / the resource it points to alone.
QMap<QString, QString> m_extra_info;
//FIXME: nuke
QWidget* m_parent;
};