aboutsummaryrefslogtreecommitdiff
path: root/launcher/InstanceImportTask.h
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-08-04 19:42:36 +0200
committerGitHub <noreply@github.com>2023-08-04 19:42:36 +0200
commitae793f6cf11658c9abc5111e82d5ba7b3e6af127 (patch)
treeed41f30e2c0f02e4be1d42324b3f05fbab75b2cd /launcher/InstanceImportTask.h
parent50c7d39e082f0a7dbd977401e16d5adf534d9770 (diff)
parent1d638e018ac40fbfb35dd117f9a948c0cf35eadd (diff)
downloadPrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.tar.gz
PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.tar.bz2
PrismLauncher-ae793f6cf11658c9abc5111e82d5ba7b3e6af127.zip
Merge pull request #1459 from Scrumplex/format
Diffstat (limited to 'launcher/InstanceImportTask.h')
-rw-r--r--launcher/InstanceImportTask.h37
1 files changed, 16 insertions, 21 deletions
diff --git a/launcher/InstanceImportTask.h b/launcher/InstanceImportTask.h
index 7fda439f..4459e440 100644
--- a/launcher/InstanceImportTask.h
+++ b/launcher/InstanceImportTask.h
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
- * PolyMC - Minecraft Launcher
+ * Prism Launcher - Minecraft Launcher
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
*
* This program is free software: you can redistribute it and/or modify
@@ -35,54 +35,49 @@
#pragma once
-#include "InstanceTask.h"
-#include "net/NetJob.h"
-#include <QUrl>
#include <QFuture>
#include <QFutureWatcher>
-#include "settings/SettingsObject.h"
+#include <QUrl>
+#include "InstanceTask.h"
#include "QObjectPtr.h"
#include "modplatform/flame/PackManifest.h"
+#include "net/NetJob.h"
+#include "settings/SettingsObject.h"
#include <optional>
class QuaZip;
-namespace Flame
-{
- class FileResolvingTask;
+namespace Flame {
+class FileResolvingTask;
}
-class InstanceImportTask : public InstanceTask
-{
+class InstanceImportTask : public InstanceTask {
Q_OBJECT
-public:
+ public:
explicit InstanceImportTask(const QUrl sourceUrl, QWidget* parent = nullptr, QMap<QString, QString>&& extra_info = {});
bool abort() override;
- const QVector<Flame::File> &getBlockedFiles() const
- {
- return m_blockedMods;
- }
+ const QVector<Flame::File>& getBlockedFiles() const { return m_blockedMods; }
-protected:
+ protected:
//! Entry point for tasks.
virtual void executeTask() override;
-private:
+ private:
void processZipPack();
void processMultiMC();
void processTechnic();
void processFlame();
void processModrinth();
-private slots:
+ private slots:
void downloadSucceeded();
void downloadFailed(QString reason);
void downloadProgressChanged(qint64 current, qint64 total);
void downloadAborted();
void extractFinished();
-private: /* data */
+ private: /* data */
NetJob::Ptr m_filesNetJob;
shared_qobject_ptr<Flame::FileResolvingTask> m_modIdResolver;
QUrl m_sourceUrl;
@@ -92,7 +87,7 @@ private: /* data */
QFuture<std::optional<QStringList>> m_extractFuture;
QFutureWatcher<std::optional<QStringList>> m_extractFutureWatcher;
QVector<Flame::File> m_blockedMods;
- enum class ModpackType{
+ enum class ModpackType {
Unknown,
MultiMC,
Technic,
@@ -104,6 +99,6 @@ private: /* data */
// the source URL / the resource it points to alone.
QMap<QString, QString> m_extra_info;
- //FIXME: nuke
+ // FIXME: nuke
QWidget* m_parent;
};