File indexing completed on 2024-04-14 15:49:36

0001 // SPDX-FileCopyrightText: 2020 Simon Persson <simon.persson@mykolab.com>
0002 //
0003 // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0004 
0005 #ifndef EDEXECUTOR_H
0006 #define EDEXECUTOR_H
0007 
0008 #include "planexecutor.h"
0009 
0010 #include <Solid/Device>
0011 #include <Solid/StorageAccess>
0012 
0013 class BackupPlan;
0014 
0015 // Plan executor that stores the backup to an external disk.
0016 // Uses libsolid to monitor for when it becomes available.
0017 class EDExecutor: public PlanExecutor
0018 {
0019 Q_OBJECT
0020 
0021 public:
0022     EDExecutor(BackupPlan *pPlan, KupDaemon *pKupDaemon);
0023 
0024 public slots:
0025     void checkStatus() override;
0026     void showBackupFiles() override;
0027     void showBackupPurger() override;
0028 
0029 protected slots:
0030     void deviceAdded(const QString &pUdi);
0031     void deviceRemoved(const QString &pUdi);
0032     void updateAccessibility();
0033     void startBackup() override;
0034 
0035 protected:
0036     bool ensureAccessible(bool &pReturnLater);
0037     Solid::StorageAccess *mStorageAccess;
0038     QString mCurrentUdi;
0039     bool mWantsToRunBackup;
0040     bool mWantsToShowFiles;
0041     bool mWantsToPurge;
0042 };
0043 
0044 #endif // EDEXECUTOR_H