Some checks failed
CodeQL Code Scanning / CodeQL (push) Has been cancelled
Build Application / Build Debug (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (macos-13, x86_64-darwin) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (macos-14, aarch64-darwin) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (ubuntu-22.04, x86_64-linux) (push) Has been cancelled
Nix / Build (${{ matrix.system }}) (ubuntu-22.04-arm, aarch64-linux) (push) Has been cancelled
Update Flake Lockfile / update-flake (push) Has been cancelled
43 lines
977 B
C++
Executable File
43 lines
977 B
C++
Executable File
// SPDX-FileCopyrightText: 2022 Sefa Eyeoglu <contact@scrumplex.net>
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-only
|
|
|
|
#pragma once
|
|
|
|
#include "FileSystem.h"
|
|
#include "pathmatcher/IPathMatcher.h"
|
|
#include "tasks/Task.h"
|
|
|
|
#include <QFuture>
|
|
#include <QFutureWatcher>
|
|
|
|
/*
|
|
* Migrate existing data from other MMC-like launchers.
|
|
*/
|
|
|
|
class DataMigrationTask : public Task {
|
|
Q_OBJECT
|
|
public:
|
|
explicit DataMigrationTask(const QString& sourcePath, const QString& targetPath, IPathMatcher::Ptr pathmatcher);
|
|
~DataMigrationTask() override = default;
|
|
|
|
protected:
|
|
virtual void executeTask() override;
|
|
|
|
protected slots:
|
|
void dryRunFinished();
|
|
void dryRunAborted();
|
|
void copyFinished();
|
|
void copyAborted();
|
|
|
|
private:
|
|
const QString& m_sourcePath;
|
|
const QString& m_targetPath;
|
|
const IPathMatcher::Ptr m_pathMatcher;
|
|
|
|
FS::copy m_copy;
|
|
int m_toCopy = 0;
|
|
QFuture<bool> m_copyFuture;
|
|
QFutureWatcher<bool> m_copyFutureWatcher;
|
|
};
|