2018-05-19 15:04:14 +02:00
|
|
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
|
|
|
*
|
2020-06-22 22:32:47 +02:00
|
|
|
* SPDX-FileCopyrightText: 2018 Adriaan de Groot <groot@kde.org>
|
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
* License-Filename: LICENSE
|
2018-05-19 15:04:14 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PRESERVEFILES_H
|
|
|
|
#define PRESERVEFILES_H
|
|
|
|
|
|
|
|
#include "CppJob.h"
|
2020-02-17 11:37:35 +01:00
|
|
|
#include "DllMacro.h"
|
2020-06-22 22:32:47 +02:00
|
|
|
#include "utils/Permissions.h"
|
2018-05-19 15:04:14 +02:00
|
|
|
#include "utils/PluginFactory.h"
|
|
|
|
|
2020-06-22 22:32:47 +02:00
|
|
|
#include <QList>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QVariantMap>
|
2018-05-19 15:04:14 +02:00
|
|
|
|
|
|
|
class PLUGINDLLEXPORT PreserveFiles : public Calamares::CppJob
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
enum class ItemType
|
|
|
|
{
|
|
|
|
None,
|
|
|
|
Path,
|
|
|
|
Log,
|
|
|
|
Config
|
2020-06-22 22:32:47 +02:00
|
|
|
};
|
2018-05-19 15:04:14 +02:00
|
|
|
|
|
|
|
struct Item
|
|
|
|
{
|
|
|
|
QString source;
|
|
|
|
QString dest;
|
2018-10-01 11:02:56 +02:00
|
|
|
Permissions perm;
|
2018-05-19 15:04:14 +02:00
|
|
|
ItemType type;
|
2020-06-22 22:32:47 +02:00
|
|
|
};
|
2018-05-19 15:04:14 +02:00
|
|
|
|
|
|
|
using ItemList = QList< Item >;
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit PreserveFiles( QObject* parent = nullptr );
|
|
|
|
virtual ~PreserveFiles() override;
|
|
|
|
|
|
|
|
QString prettyName() const override;
|
|
|
|
|
|
|
|
Calamares::JobResult exec() override;
|
|
|
|
|
|
|
|
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
ItemList m_items;
|
|
|
|
};
|
|
|
|
|
|
|
|
CALAMARES_PLUGIN_FACTORY_DECLARATION( PreserveFilesFactory )
|
|
|
|
|
2020-06-22 22:32:47 +02:00
|
|
|
#endif // PRESERVEFILES_H
|