MailCommon::FolderJob Class

class MailCommon::FolderJob

The FolderJob class. More...

Header: #include <MailCommon/FolderJob>
CMake: find_package(KPim6MailCommon REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::MailCommon)
Inherits: QObject
Inherited By:

MailCommon::ScheduledJob

Public Functions

FolderJob(QObject *parent = nullptr)
virtual ~FolderJob() override
int error() const
bool isCancellable() const
virtual void kill()
void setCancellable(bool b)
void start()

Signals

void finished()
void result(MailCommon::FolderJob *job)

Protected Functions

virtual void execute() = 0

Detailed Description

Member Function Documentation

[explicit] FolderJob::FolderJob(QObject *parent = nullptr)

Constructs a folder job.

parent The parent object

[override virtual noexcept] FolderJob::~FolderJob()

Destroys the folder job.

int FolderJob::error() const

Returns the error code of the job. This must only be called from the slot connected to the finished() signal.

Returns The error code

[pure virtual protected] void FolderJob::execute()

Has to be reimplemented. It's called by the start() method. Should start the processing of the specified job function.

[signal] void FolderJob::finished()

Emitted when the job finishes all processing.

bool FolderJob::isCancellable() const

Returns true if this job can be canceled, e.g. to exit the application

Returns True if the job is cancellable, false otherwise

[virtual] void FolderJob::kill()

Interrupt the job. Note that the finished() and result() signal will be emitted, unless you called setPassiveDestructor(true) before. This kills the job, don't use it afterwards.

[signal] void FolderJob::result(MailCommon::FolderJob *job)

Emitted when the job finishes all processing. More convenient signal than finished(), since it provides a pointer to the job. This signal is emitted by the FolderJob destructor => do NOT downcast the job to a subclass!

job Pointer to this job

void FolderJob::setCancellable(bool b)

Call this to change the "cancellable" property of this job. By default, tListMessages, tGetMessage, tGetFolder and tCheckUidValidity are cancellable, the others are not. But when copying, a non-cancellable tGetMessage is needed.

b Whether the job should be cancellable

See also isCancellable().

void FolderJob::start()

Start the job