KIO

emptytrashjob.cpp
1 /* This file is part of the KDE libraries
2  Copyright (C) 2014 David Faure <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "emptytrashjob.h"
21 #include "job.h"
22 #include "job_p.h"
23 //#include <KNotification>
24 
25 using namespace KIO;
26 
27 class KIO::EmptyTrashJobPrivate: public SimpleJobPrivate
28 {
29 public:
30  EmptyTrashJobPrivate(int command, const QByteArray &packedArgs)
31  : SimpleJobPrivate(QUrl(QStringLiteral("trash:/")), command, packedArgs)
32  { }
33 
34  Q_DECLARE_PUBLIC(EmptyTrashJob)
35 
36  static inline EmptyTrashJob *newJob(int command, const QByteArray &packedArgs)
37  {
38  EmptyTrashJob *job = new EmptyTrashJob(*new EmptyTrashJobPrivate(command, packedArgs));
40  return job;
41  }
42 };
43 
44 EmptyTrashJob::EmptyTrashJob(EmptyTrashJobPrivate &dd)
45  : SimpleJob(dd)
46 {
47 }
48 
49 EmptyTrashJob::~EmptyTrashJob()
50 {
51 }
52 
53 // TODO KF6: remove this
55 {
57 }
58 
60 {
61  KIO_ARGS << int(1);
62  return EmptyTrashJobPrivate::newJob(CMD_SPECIAL, packedArgs);
63 }
64 
65 #include "moc_emptytrashjob.cpp"
void setUiDelegate(KJobUiDelegate *delegate)
A namespace for KIO globals.
Definition: authinfo.h:34
void slotFinished() override
Called when the slave marks the job as finished.
KIOCORE_EXPORT EmptyTrashJob * emptyTrash()
Empties the trash.
KIOCORE_EXPORT KJobUiDelegate * createDefaultJobUiDelegate()
Convenience method: use default factory, if there&#39;s one, to create a delegate and return it...
virtual void slotFinished()
Called when the slave marks the job as finished.
Definition: simplejob.cpp:206
A KIO job for emptying the trash.
Definition: emptytrashjob.h:38
A simple job (one url and one command).
Definition: simplejob.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 11 2020 23:00:25 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.