2016-10-02 23:55:54 +01:00
|
|
|
#pragma once
|
|
|
|
|
2016-10-26 17:12:33 +01:00
|
|
|
#include <QFuture>
|
|
|
|
#include <QFutureWatcher>
|
2022-10-22 19:50:32 +01:00
|
|
|
#include <QUrl>
|
2016-10-02 23:55:54 +01:00
|
|
|
#include "BaseInstance.h"
|
2022-10-22 19:50:32 +01:00
|
|
|
#include "BaseVersion.h"
|
|
|
|
#include "InstanceCopyPrefs.h"
|
2018-03-19 01:36:12 +00:00
|
|
|
#include "InstanceTask.h"
|
2022-10-22 19:50:32 +01:00
|
|
|
#include "net/NetJob.h"
|
|
|
|
#include "settings/SettingsObject.h"
|
|
|
|
#include "tasks/Task.h"
|
2016-10-26 17:12:33 +01:00
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
class InstanceCopyTask : public InstanceTask {
|
2018-07-15 13:51:05 +01:00
|
|
|
Q_OBJECT
|
2023-08-02 17:35:35 +01:00
|
|
|
public:
|
2022-10-23 04:04:36 +01:00
|
|
|
explicit InstanceCopyTask(InstancePtr origInstance, const InstanceCopyPrefs& prefs);
|
2016-10-02 23:55:54 +01:00
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
protected:
|
2018-07-15 13:51:05 +01:00
|
|
|
//! Entry point for tasks.
|
|
|
|
virtual void executeTask() override;
|
|
|
|
void copyFinished();
|
|
|
|
void copyAborted();
|
2016-10-02 23:55:54 +01:00
|
|
|
|
2023-08-02 17:35:35 +01:00
|
|
|
private:
|
2022-10-22 19:50:32 +01:00
|
|
|
/* data */
|
2018-07-15 13:51:05 +01:00
|
|
|
InstancePtr m_origInstance;
|
|
|
|
QFuture<bool> m_copyFuture;
|
|
|
|
QFutureWatcher<bool> m_copyFutureWatcher;
|
|
|
|
std::unique_ptr<IPathMatcher> m_matcher;
|
2020-01-09 14:31:32 +00:00
|
|
|
bool m_keepPlaytime;
|
2023-02-08 22:30:45 +00:00
|
|
|
bool m_useLinks = false;
|
|
|
|
bool m_useHardLinks = false;
|
2023-02-09 01:39:17 +00:00
|
|
|
bool m_copySaves = false;
|
|
|
|
bool m_linkRecursively = false;
|
2023-02-09 09:02:40 +00:00
|
|
|
bool m_useClone = false;
|
2016-10-02 23:55:54 +01:00
|
|
|
};
|