Home · All Classes · All Namespaces · Modules · Functions · Files |
The PendingOperation class is a base class for pending asynchronous operations. More...
#include <TelepathyQt4/PendingOperation>
Inherits QObject.
Inherited by Tp::PendingAccount, Tp::PendingChannel, Tp::PendingChannelRequest, Tp::PendingComposite, Tp::PendingConnection, Tp::PendingContactAttributes, Tp::PendingContactInfo, Tp::PendingContacts, Tp::PendingFailure, Tp::PendingHandles, Tp::PendingReady, Tp::PendingSendMessage, Tp::PendingStreamedMediaStreams, Tp::PendingStreamTubeConnection, Tp::PendingStringList, Tp::PendingSuccess, Tp::PendingVariant, Tp::PendingVariantMap, and Tp::PendingVoid.
The PendingOperation class is a base class for pending asynchronous operations.
This class represents an incomplete asynchronous operation, such as a D-Bus method call. When the operation has finished, it emits finished(). The slot or slots connected to the finished() signal may obtain additional information from the pending operation.
In simple cases, like a D-Bus method with no 'out' arguments or for which all 'out' arguments are to be ignored (so the possible results are success with no extra information, or failure with an error code), the trivial subclass PendingVoid can be used.
For pending operations that produce a result, another subclass of PendingOperation can be used, with additional methods that provide that result to the library user.
After finished() is emitted, the PendingOperation is automatically deleted using deleteLater(), so library users must not explicitly delete this object.
The design is loosely based on KDE's KJob.
Tp::PendingOperation::~PendingOperation | ( | ) | [virtual] |
Class destructor.
Tp::PendingOperation::PendingOperation | ( | const SharedPtr< RefCounted > & | object | ) | [protected] |
Construct a new PendingOperation object.
object | The object on which this pending operation takes place. |
SharedPtr< RefCounted > Tp::PendingOperation::object | ( | ) | const |
Return the object on which this pending operation takes place.
bool Tp::PendingOperation::isFinished | ( | ) | const |
Return whether or not the request has finished processing.
The signal finished() is emitted when this changes from false
to true.
Equivalent to (isValid() || isError())
.
true
if the request has finished, false
otherwise. bool Tp::PendingOperation::isValid | ( | ) | const |
Return whether or not the request completed successfully. If the request has not yet finished processing (isFinished() returns false
), this cannot yet be known, and false
will be returned.
Equivalent to (isFinished() && !isError())
.
true
if the request has finished processing and has completed successfully, false
otherwise. bool Tp::PendingOperation::isError | ( | ) | const |
Return whether or not the request resulted in an error.
If the request has not yet finished processing (isFinished() returns false
), this cannot yet be known, and false
will be returned.
Equivalent to (isFinished() && !isValid())
.
true
if the request has finished processing and has resulted in an error, false
otherwise. QString Tp::PendingOperation::errorName | ( | ) | const |
If isError() returns true
, returns the D-Bus error with which the operation failed. If the operation succeeded or has not yet finished, returns an empty string.
QString Tp::PendingOperation::errorMessage | ( | ) | const |
If isError() would return true
, returns a debugging message associated with the error, which may be an empty string. Otherwise, return an empty string.
void Tp::PendingOperation::finished | ( | Tp::PendingOperation * | operation | ) | [signal] |
Emitted when the pending operation finishes, i.e. when isFinished() changes from false
to true
.
operation | This operation object, from which further information may be obtained. |
SharedPtr< RefCounted > Tp::PendingOperation::_object | ( | ) | const [protected] |
void Tp::PendingOperation::setFinished | ( | ) | [protected, slot] |
Record that this pending operation has finished successfully, and emit the finished() signal next time the event loop runs.
void Tp::PendingOperation::setFinishedWithError | ( | const QString & | name, |
const QString & | message | ||
) | [protected, slot] |
Record that this pending operation has finished with an error, and emit the finished() signal next time the event loop runs.
name | The D-Bus error name, which must be non-empty. |
message | The debugging message. |
void Tp::PendingOperation::setFinishedWithError | ( | const QDBusError & | error | ) | [protected, slot] |
Record that this pending operation has finished with an error, and emit the finished() signal next time the event loop runs.
error | The error. |
Copyright © 2008-2011 Collabora Ltd. and Nokia Corporation | Telepathy-Qt4 0.8.0 |