File indexing completed on 2024-04-28 17:03:20

0001 /*
0002  * SPDX-FileCopyrightText: 2012 Peter Penz <peter.penz19@gmail.com>
0003  * SPDX-FileCopyrightText: 2018 Roman Inflianskas <infroma@gmail.com>
0004  *
0005  * SPDX-License-Identifier: GPL-2.0-or-later
0006  */
0007 
0008 #ifndef DOLPHINTRASH_H
0009 #define DOLPHINTRASH_H
0010 
0011 #include <QWidget>
0012 
0013 #include <KDirLister>
0014 #include <KIO/EmptyTrashJob>
0015 
0016 class Trash : public QObject
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     // delete copy and move constructors and assign operators
0022     Trash(Trash const &) = delete;
0023     Trash(Trash &&) = delete;
0024     Trash &operator=(Trash const &) = delete;
0025     Trash &operator=(Trash &&) = delete;
0026 
0027     static Trash &instance();
0028     static void empty(QWidget *window);
0029     static bool isEmpty();
0030 
0031 Q_SIGNALS:
0032     void emptinessChanged(bool isEmpty);
0033 
0034 private:
0035     KDirLister *m_trashDirLister;
0036 
0037     Trash();
0038     ~Trash() override;
0039 };
0040 
0041 #endif // DOLPHINTRASH_H