2020-09-30 23:28:47 +01:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2008-2010 Volker Lanz <vl@fidra.de>
|
|
|
|
SPDX-FileCopyrightText: 2014-2018 Andrius Štikonas <andrius@stikonas.eu>
|
|
|
|
SPDX-FileCopyrightText: 2015 Chris Campbell <c.j.campbell@ed.ac.uk>
|
2015-06-04 01:29:22 +01:00
|
|
|
|
2020-09-30 23:28:47 +01:00
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KPMCORE_BACKUPOPERATION_H
|
2017-09-10 20:12:52 +01:00
|
|
|
#define KPMCORE_BACKUPOPERATION_H
|
2015-06-04 01:29:22 +01:00
|
|
|
|
2016-05-06 22:36:24 +01:00
|
|
|
#include "util/libpartitionmanagerexport.h"
|
2015-06-04 01:29:22 +01:00
|
|
|
|
2016-05-06 22:36:24 +01:00
|
|
|
#include "ops/operation.h"
|
2015-06-04 01:29:22 +01:00
|
|
|
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
class Partition;
|
|
|
|
class Device;
|
|
|
|
class BackupFileSystemJob;
|
|
|
|
|
|
|
|
/** Back up a FileSystem.
|
2015-07-13 15:16:36 +01:00
|
|
|
@author Volker Lanz <vl@fidra.de>
|
2015-06-04 01:29:22 +01:00
|
|
|
*/
|
|
|
|
class LIBKPMCORE_EXPORT BackupOperation : public Operation
|
|
|
|
{
|
2015-07-13 15:16:36 +01:00
|
|
|
Q_DISABLE_COPY(BackupOperation)
|
|
|
|
|
|
|
|
public:
|
|
|
|
BackupOperation(Device& targetDevice, Partition& backupPartition, const QString& filename);
|
|
|
|
|
|
|
|
public:
|
2016-04-27 21:54:02 +01:00
|
|
|
QString iconName() const override {
|
2015-07-13 15:16:36 +01:00
|
|
|
return QStringLiteral("document-export");
|
|
|
|
}
|
2016-04-27 21:54:02 +01:00
|
|
|
QString description() const override;
|
|
|
|
void preview() override {}
|
|
|
|
void undo() override {}
|
2015-07-13 15:16:36 +01:00
|
|
|
|
2016-05-17 18:01:31 +01:00
|
|
|
bool targets(const Device&) const override {
|
2015-07-13 15:16:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
2016-05-17 18:01:31 +01:00
|
|
|
bool targets(const Partition&) const override{
|
2015-07-13 15:16:36 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool canBackup(const Partition* p);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
Device& targetDevice() {
|
|
|
|
return m_TargetDevice;
|
|
|
|
}
|
2018-03-31 23:49:37 +01:00
|
|
|
|
2015-07-13 15:16:36 +01:00
|
|
|
const Device& targetDevice() const {
|
|
|
|
return m_TargetDevice;
|
|
|
|
}
|
|
|
|
|
|
|
|
Partition& backupPartition() {
|
|
|
|
return m_BackupPartition;
|
|
|
|
}
|
|
|
|
const Partition& backupPartition() const {
|
|
|
|
return m_BackupPartition;
|
|
|
|
}
|
|
|
|
|
|
|
|
const QString& fileName() const {
|
|
|
|
return m_FileName;
|
|
|
|
}
|
|
|
|
|
|
|
|
BackupFileSystemJob* backupJob() {
|
|
|
|
return m_BackupJob;
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
Device& m_TargetDevice;
|
|
|
|
Partition& m_BackupPartition;
|
|
|
|
const QString m_FileName;
|
|
|
|
BackupFileSystemJob* m_BackupJob;
|
2015-06-04 01:29:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|