1 | /* |
---|---|
2 | This file is part of the KDE libraries |
3 | SPDX-FileCopyrightText: 2014 David Faure <faure@kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-or-later |
6 | */ |
7 | |
8 | #include "emptytrashjob.h" |
9 | #include "job.h" |
10 | #include "job_p.h" |
11 | // #include <KNotification> |
12 | |
13 | using namespace KIO; |
14 | |
15 | class KIO::EmptyTrashJobPrivate : public SimpleJobPrivate |
16 | { |
17 | public: |
18 | EmptyTrashJobPrivate(int command, const QByteArray &packedArgs) |
19 | : SimpleJobPrivate(QUrl(QStringLiteral("trash:/")), command, packedArgs) |
20 | { |
21 | } |
22 | |
23 | Q_DECLARE_PUBLIC(EmptyTrashJob) |
24 | |
25 | static inline EmptyTrashJob *newJob(int command, const QByteArray &packedArgs) |
26 | { |
27 | EmptyTrashJob *job = new EmptyTrashJob(*new EmptyTrashJobPrivate(command, packedArgs)); |
28 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); |
29 | return job; |
30 | } |
31 | }; |
32 | |
33 | EmptyTrashJob::EmptyTrashJob(EmptyTrashJobPrivate &dd) |
34 | : SimpleJob(dd) |
35 | { |
36 | } |
37 | |
38 | EmptyTrashJob::~EmptyTrashJob() |
39 | { |
40 | } |
41 | |
42 | // TODO KF6: remove this |
43 | void EmptyTrashJob::slotFinished() |
44 | { |
45 | SimpleJob::slotFinished(); |
46 | } |
47 | |
48 | KIO::EmptyTrashJob *KIO::emptyTrash() |
49 | { |
50 | KIO_ARGS << int(1); |
51 | return EmptyTrashJobPrivate::newJob(command: CMD_SPECIAL, packedArgs); |
52 | } |
53 | |
54 | #include "moc_emptytrashjob.cpp" |
55 |