49 #include <private/qobject_p.h> 142 q_dbus_pending_call_cancel(pending);
143 q_dbus_pending_call_unref(pending);
145 delete watcherHelper;
156 if (!member || !*member) {
158 qWarning(
"QDBusPendingCall::setReplyCallback: error: cannot deliver a reply to %s::%s (%s)",
160 member ? member + 1 :
"(null)",
166 if (methodIdx == -1) {
170 if (methodIdx == -1) {
172 qWarning(
"QDBusPendingCall::setReplyCallback: error: cannot deliver a reply to %s::%s (%s)",
180 int count = metaTypes.count() - 1;
190 setMetaTypes(count, 0);
193 setMetaTypes(count, types.
constData() + 1);
200 expectedReplyCount = count;
207 sig.
reserve(count + count / 2);
208 for (
int i = 0; i < count; ++i) {
211 qFatal(
"QDBusPendingReply: type %s is not registered with QtDBus",
230 if (expectedReplySignature.isNull())
234 if (!replyMessage.signature().indexOf(expectedReplySignature) == 0) {
239 errorMsg.
arg(replyMessage.signature(), expectedReplySignature));
251 connection->waitForFinished(
this);
337 bool QDBusPendingCall::isFinished()
const 346 void QDBusPendingCall::waitForFinished()
363 bool QDBusPendingCall::isValid()
const 383 bool QDBusPendingCall::isError()
const 456 bool QDBusPendingCall::setReplyCallback(
QObject *target,
const char *member)
581 #include "moc_qdbuspendingcall.cpp"
friend class QDBusPendingCallPrivate
static QDBusMessage createError(const QString &name, const QString &msg)
Constructs a new DBus message representing an error, with the given name and msg. ...
void checkReceivedSignature()
#define QT_END_NAMESPACE
This macro expands to.
QDBusMessage replyMessage
QString objectName
the name of this object
The QByteArray class provides an array of bytes.
bool setReplyCallback(QObject *target, const char *member)
The QDBusError class represents an error received from the D-Bus bus or from remote applications foun...
The QDBusPendingCall class refers to one pending asynchronous call.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QDBusPendingCallWatcher class provides a convenient way for waiting for asynchronous replies...
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
static int findSlot(QObject *obj, const QByteArray &normalizedName, QList< int > ¶ms)
QExplicitlySharedDataPointer< QDBusPendingCallPrivate > d
void add(QDBusPendingCallWatcher *watcher)
~QDBusPendingCallPrivate()
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
void setMetaTypes(int count, const int *types)
bool deref()
Atomically decrements the value of this QAtomicInt.
static QVector< T > fromList(const QList< T > &list)
Returns a QVector object with the data contained in list.
Q_CORE_EXPORT void qWarning(const char *,...)
static void sendPostedEvents()
QDBusPendingCallWatcher(const QDBusPendingCall &call, QObject *parent=0)
Creates a QDBusPendingCallWatcher object to watch for replies on the asynchronous pending call call a...
void waitForFinished()
Suspends the execution of the calling thread until the reply is received and processed.
QDBusPendingCall & operator=(const QDBusPendingCall &other)
Creates a copy of the other pending asynchronous call and drops the reference to the previously-refer...
Q_CORE_EXPORT void qFatal(const char *,...)
The QMutexLocker class is a convenience class that simplifies locking and unlocking mutexes...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
#define Q_DECLARE_PUBLIC(Class)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
~QDBusPendingCall()
Destroys this copy of the QDBusPendingCall object.
QDBusPendingCallWatcherHelper * watcherHelper
The QDBusMessage class represents one message sent or received over the D-Bus bus.
MessageType type() const
Returns the message type.
static QDBusPendingCall fromCompletedCall(const QDBusMessage &message)
Creates a QDBusPendingCall object based on the message msg.
static QDBusPendingCall fromError(const QDBusError &error)
Creates a QDBusPendingCall object based on the error condition error.
const T * constData() const
Returns a const pointer to the data stored in the vector.
void reserve(int size)
Attempts to allocate memory for at least size bytes.
#define qPrintable(string)
~QDBusPendingCallWatcher()
Destroys this object.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.