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