File: krtrashhandler.h

package info (click to toggle)
krusader 2%3A2.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 25,448 kB
  • sloc: cpp: 56,112; ansic: 1,187; xml: 811; sh: 23; makefile: 3
file content (49 lines) | stat: -rw-r--r-- 970 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
    SPDX-FileCopyrightText: 2009 Csaba Karai <krusader@users.sourceforge.net>
    SPDX-FileCopyrightText: 2009-2022 Krusader Krew <https://krusader.org>

    SPDX-License-Identifier: GPL-2.0-or-later
*/

#ifndef KRTRASHHANDLER_H
#define KRTRASHHANDLER_H

// QtCore
#include <QString>
#include <QUrl>

#include <KDirWatch>

class KrTrashWatcher;

class KrTrashHandler
{
public:
    static bool isTrashEmpty();
    static QString trashIconName();
    static void emptyTrash();
    static void restoreTrashedFiles(const QList<QUrl> &url);
    static void startWatcher();
    static void stopWatcher();

private:
    static KrTrashWatcher *_trashWatcher;
};

/** Watches the trashrc config file for changes and updates the trash icon. */
class KrTrashWatcher : public QObject
{
    Q_OBJECT

public:
    KrTrashWatcher();
    ~KrTrashWatcher() override;

public slots:
    void slotTrashChanged();

private:
    KDirWatch *_watcher;
};

#endif /* __KR_TRASH_HANDLER__ */