File indexing completed on 2024-04-28 04:21:24
0001 // SPDX-FileCopyrightText: 2012-2022 Jesper K. Pedersen <blackie@kde.org> 0002 // 0003 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0004 0005 #ifndef UTILITIES_DELETEFILES_H 0006 #define UTILITIES_DELETEFILES_H 0007 0008 #include <kpabase/FileNameList.h> 0009 0010 #include <QObject> 0011 0012 class KJob; 0013 0014 namespace Utilities 0015 { 0016 0017 enum DeleteMethod { DeleteFromDisk, 0018 MoveToTrash, 0019 BlockFromDatabase }; 0020 0021 class DeleteFiles : public QObject 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 static bool deleteFiles(const DB::FileNameList &files, DeleteMethod method); 0027 0028 private Q_SLOTS: 0029 void slotKIOJobCompleted(KJob *); 0030 0031 private: 0032 static DeleteFiles *s_instance; 0033 bool deleteFilesPrivate(const DB::FileNameList &files, DeleteMethod method); 0034 }; 0035 0036 } // namespace Utilities 0037 0038 #endif // UTILITIES_DELETEFILES_H 0039 // vi:expandtab:tabstop=4 shiftwidth=4: