71 class QDBusConnectionPrivate; |
73 class QDBusConnectionPrivate; |
72 |
74 |
73 class QDBusPendingCallPrivate: public QSharedData |
75 class QDBusPendingCallPrivate: public QSharedData |
74 { |
76 { |
75 public: |
77 public: |
76 QDBusMessage sentMessage; |
78 // { |
77 QDBusMessage replyMessage; |
79 // set only during construction: |
78 // QDBusMessage pendingReplyMessage; // used in the local loop |
80 const QDBusMessage sentMessage; |
79 QDBusPendingCallWatcherHelper *watcherHelper; |
81 QDBusConnectionPrivate * const connection; |
80 DBusPendingCall *pending; |
|
81 QDBusConnectionPrivate *connection; |
|
82 |
82 |
83 QString expectedReplySignature; |
83 // for the callback mechanism (see setReplyCallback and QDBusConnectionPrivate::sendWithReplyAsync) |
84 int expectedReplyCount; |
|
85 |
|
86 // for the callback |
|
87 QPointer<QObject> receiver; |
84 QPointer<QObject> receiver; |
88 QList<int> metaTypes; |
85 QList<int> metaTypes; |
89 int methodIdx; |
86 int methodIdx; |
90 |
87 |
91 bool autoDelete; |
88 bool autoDelete; |
|
89 // } |
92 |
90 |
93 QDBusPendingCallPrivate() : watcherHelper(0), pending(0), autoDelete(false) |
91 mutable QMutex mutex; |
|
92 QWaitCondition waitForFinishedCondition; |
|
93 |
|
94 // { |
|
95 // protected by the mutex above: |
|
96 QDBusPendingCallWatcherHelper *watcherHelper; |
|
97 QDBusMessage replyMessage; |
|
98 DBusPendingCall *pending; |
|
99 volatile bool waitingForFinished; |
|
100 |
|
101 QString expectedReplySignature; |
|
102 int expectedReplyCount; |
|
103 // } |
|
104 |
|
105 QDBusPendingCallPrivate(const QDBusMessage &sent, QDBusConnectionPrivate *connection) |
|
106 : sentMessage(sent), connection(connection), autoDelete(false), watcherHelper(0), pending(0), waitingForFinished(false) |
94 { } |
107 { } |
95 ~QDBusPendingCallPrivate(); |
108 ~QDBusPendingCallPrivate(); |
96 bool setReplyCallback(QObject *target, const char *member); |
109 bool setReplyCallback(QObject *target, const char *member); |
97 void waitForFinished(); |
110 void waitForFinished(); |
98 void setMetaTypes(int count, const int *types); |
111 void setMetaTypes(int count, const int *types); |