2017-09-20 21:38:31 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "tasks/Task.h"
|
|
|
|
#include "multimc_logic_export.h"
|
|
|
|
#include "net/NetJob.h"
|
|
|
|
#include <QUrl>
|
|
|
|
#include <QFuture>
|
|
|
|
#include <QFutureWatcher>
|
|
|
|
#include "settings/SettingsObject.h"
|
|
|
|
#include "BaseVersion.h"
|
|
|
|
#include "BaseInstance.h"
|
|
|
|
|
|
|
|
|
|
|
|
class BaseInstanceProvider;
|
|
|
|
|
2017-09-26 11:38:34 +00:00
|
|
|
class MULTIMC_LOGIC_EXPORT LegacyUpgradeTask : public Task
|
2017-09-20 21:38:31 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2017-09-26 11:38:34 +00:00
|
|
|
explicit LegacyUpgradeTask(SettingsObjectPtr settings, const QString & stagingPath, InstancePtr origInstance, const QString & newName);
|
2017-09-20 21:38:31 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
//! Entry point for tasks.
|
|
|
|
virtual void executeTask() override;
|
|
|
|
void copyFinished();
|
|
|
|
void copyAborted();
|
|
|
|
|
|
|
|
private: /* data */
|
|
|
|
SettingsObjectPtr m_globalSettings;
|
|
|
|
InstancePtr m_origInstance;
|
|
|
|
QString m_stagingPath;
|
2017-09-26 11:38:34 +00:00
|
|
|
QString m_newName;
|
2017-09-20 21:38:31 +00:00
|
|
|
QFuture<bool> m_copyFuture;
|
|
|
|
QFutureWatcher<bool> m_copyFutureWatcher;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|