Mailcommon

folderjob.cpp
1 /*
2  *
3  * SPDX-FileCopyrightText: 2003 Zack Rusin <[email protected]>
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  */
7 
8 #include "folderjob.h"
9 
10 #include <KIO/Global>
11 
12 using namespace MailCommon;
13 
14 //----------------------------------------------------------------------------
15 FolderJob::FolderJob(QObject *parent)
16  : QObject(parent)
17 {
18 }
19 
20 //----------------------------------------------------------------------------
21 FolderJob::~FolderJob()
22 {
23  Q_EMIT result(this);
24  Q_EMIT finished();
25 }
26 
27 //----------------------------------------------------------------------------
29 {
30  if (!mStarted) {
31  mStarted = true;
32  execute();
33  }
34 }
35 
36 //----------------------------------------------------------------------------
38 {
39  mErrorCode = KIO::ERR_USER_CANCELED;
40  delete this;
41 }
42 
43 int FolderJob::error() const
44 {
45  return mErrorCode;
46 }
47 
49 {
50  return mCancellable;
51 }
52 
54 {
55  mCancellable = b;
56 }
57 
58 #include "moc_folderjob.cpp"
Q_EMITQ_EMIT
bool isCancellable() const
Definition: folderjob.cpp:48
void result(FolderJob *job)
Emitted when the job finishes all processing.
virtual void execute()=0
Has to be reimplemented.
void start()
Start the job.
Definition: folderjob.cpp:28
virtual void kill()
Interrupt the job.
Definition: folderjob.cpp:37
void finished()
Emitted when the job finishes all processing.
void setCancellable(bool b)
Call this to change the "cancellable" property of this job.
Definition: folderjob.cpp:53
The filter dialog.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Oct 3 2023 04:00:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.