KIO::WorkerResult Class

class KIO::WorkerResult

The result of a worker call. More...

Header: #include <KIO/WorkerBase>
CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
target_link_libraries(mytarget PRIVATE KF6::KIOCore)

Public Functions

int error() const
QString errorString() const
bool success() const

Static Public Members

KIO::WorkerResult fail(int _error = KIO::ERR_UNKNOWN, const QString &_errorString = QString())
KIO::WorkerResult pass()

Detailed Description

When using the Result type always mark the function Q_REQUIRED_RESULT to enforce handling of the Result.

Member Function Documentation

int WorkerResult::error() const

The error code (or ERR_UNKNOWN) of the result.

QString WorkerResult::errorString() const

The localized error description if applicable.

[static] KIO::WorkerResult WorkerResult::fail(int _error = KIO::ERR_UNKNOWN, const QString &_errorString = QString())

Constructs a failure results.

[static] KIO::WorkerResult WorkerResult::pass()

Constructs a success result.

bool WorkerResult::success() const

Whether or not the result was a success.