2014-08-05 17:38:26 +02:00
|
|
|
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
|
|
|
*
|
|
|
|
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
|
|
|
*
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calamares is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
// This class is heavily based on the MoveFileSystemJob class from KDE Partition
|
|
|
|
// Manager. Original copyright follow:
|
|
|
|
|
|
|
|
/***************************************************************************
|
|
|
|
* Copyright (C) 2008 by Volker Lanz <vl@fidra.de> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the *
|
|
|
|
* Free Software Foundation, Inc., *
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
|
|
|
|
***************************************************************************/
|
|
|
|
#ifndef MOVEFILESYSTEMJOB_H
|
|
|
|
#define MOVEFILESYSTEMJOB_H
|
|
|
|
|
|
|
|
#include <PartitionJob.h>
|
|
|
|
|
2014-08-05 18:27:24 +02:00
|
|
|
class CopySourceDevice;
|
|
|
|
class CopyTargetDevice;
|
2014-08-05 17:38:26 +02:00
|
|
|
class Device;
|
|
|
|
class Partition;
|
2014-08-05 18:27:24 +02:00
|
|
|
class Report;
|
2014-08-05 17:38:26 +02:00
|
|
|
|
|
|
|
class MoveFileSystemJob : public PartitionJob
|
|
|
|
{
|
|
|
|
public:
|
2014-08-05 18:27:24 +02:00
|
|
|
MoveFileSystemJob( Device* device, Partition* partition, qint64 oldFirstSector, qint64 newFirstSector, qint64 length );
|
2014-08-05 17:38:26 +02:00
|
|
|
|
|
|
|
QString prettyName() const override;
|
|
|
|
|
|
|
|
Calamares::JobResult exec() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
Device* m_device;
|
2014-08-05 18:27:24 +02:00
|
|
|
qint64 m_oldFirstSector;
|
|
|
|
qint64 m_newFirstSector;
|
|
|
|
qint64 m_length;
|
|
|
|
bool copyBlocks( Report& report, CopyTargetDevice& target, CopySourceDevice& source );
|
|
|
|
bool rollbackCopyBlocks( Report& report, CopyTargetDevice& origTarget, CopySourceDevice& origSource );
|
2014-08-05 17:38:26 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* MOVEFILESYSTEMJOB_H */
|