32 |
32 |
33 class XQServiceRequest_Private : public XQServiceRequestCompletedAsync |
33 class XQServiceRequest_Private : public XQServiceRequestCompletedAsync |
34 { |
34 { |
35 public: |
35 public: |
36 XQServiceRequest_Private(XQServiceRequest* parent) |
36 XQServiceRequest_Private(XQServiceRequest* parent) |
37 : m_Synchronous(true), m_Parent(parent),serviceManager(NULL) |
37 : mSynchronous(true), mParent(parent),mServiceManager(NULL) |
38 { |
38 { |
39 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::XQServiceRequest_Private(1)"); |
39 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::XQServiceRequest_Private(1)"); |
40 |
40 |
41 }; |
41 }; |
42 |
42 |
43 XQServiceRequest_Private(const QString& service, |
43 XQServiceRequest_Private(const QString& fullServiceName, |
44 const QString& message, |
44 const QString& message, |
45 const bool &synchronous, |
45 const bool &synchronous, |
46 XQServiceRequest* parent) |
46 XQServiceRequest* parent) |
47 : m_Service(service), m_Message(message), m_Synchronous(synchronous), m_Parent(parent),serviceManager(NULL) |
47 : mService(fullServiceName), mMessage(message), mSynchronous(synchronous), mParent(parent),mServiceManager(NULL) |
48 { |
48 { |
49 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::XQServiceRequest_Private(2)"); |
49 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::XQServiceRequest_Private(2)"); |
50 }; |
50 }; |
51 |
51 |
52 XQServiceRequest_Private(const XQAiwInterfaceDescriptor &descriptor, |
52 XQServiceRequest_Private(const XQAiwInterfaceDescriptor &descriptor, |
53 const QString& message, |
53 const QString& message, |
54 const bool &synchronous, |
54 const bool &synchronous, |
55 XQServiceRequest* parent) |
55 XQServiceRequest* parent) |
56 : m_Message(message), m_Synchronous(synchronous), m_Parent(parent),serviceManager(NULL) |
56 : mMessage(message), mSynchronous(synchronous), mParent(parent),mServiceManager(NULL) |
57 { |
57 { |
58 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::XQServiceRequest_Private(3)"); |
58 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::XQServiceRequest_Private(3)"); |
|
59 |
59 // Construct service name understood by the QtHighway FW |
60 // Construct service name understood by the QtHighway FW |
60 // (The descriptor has been created from the XML) |
61 // (The descriptor has been created from the XML) |
61 m_Service = descriptor.serviceName() + "." + descriptor.interfaceName(); |
62 mService = descriptor.serviceName() + "." + descriptor.interfaceName(); |
62 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private(3)::service=%s", qPrintable(m_Service)); |
63 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private(3)::service=%s", qPrintable(mService)); |
63 |
64 |
64 // Remember the descriptor |
65 // Remember the descriptor |
65 m_RequestUtil.mDescriptor = descriptor; |
66 mRequestUtil.mDescriptor = descriptor; |
66 }; |
67 }; |
67 |
68 |
68 ~XQServiceRequest_Private(); |
69 ~XQServiceRequest_Private(); |
69 // from XQServiceRequestCompletedAsync |
70 // from XQServiceRequestCompletedAsync |
70 void requestCompletedAsync(const QVariant &retValue); |
71 void requestCompletedAsync(const QVariant &retValue); |
71 void requestErrorAsync(int err); |
72 void requestErrorAsync(int err); |
72 |
73 |
73 QList<QVariant> m_arguments; |
74 QList<QVariant> mArguments; |
74 QString m_Service; |
75 QString mService; |
75 QString m_Message; |
76 QString mMessage; |
76 bool m_Synchronous; |
77 bool mSynchronous; |
77 XQServiceRequest* m_Parent; |
78 XQServiceRequest* mParent; |
78 XQRequestUtil m_RequestUtil; |
79 XQRequestUtil mRequestUtil; |
79 XQServiceManager* serviceManager; |
80 XQServiceManager* mServiceManager; |
80 QString m_uniqueChannelName; |
81 QString mUniqueChannelName; |
81 |
82 |
82 }; |
83 }; |
83 |
84 |
84 XQServiceRequest_Private::~XQServiceRequest_Private() |
85 XQServiceRequest_Private::~XQServiceRequest_Private() |
85 { |
86 { |
86 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::~XQServiceRequest_Private"); |
87 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::~XQServiceRequest_Private"); |
87 delete serviceManager; |
88 delete mServiceManager; |
88 }; |
89 }; |
89 |
90 |
90 void XQServiceRequest_Private::requestCompletedAsync(const QVariant &retValue) |
91 void XQServiceRequest_Private::requestCompletedAsync(const QVariant &retValue) |
91 { |
92 { |
92 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::requestCompletedAsync"); |
93 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::requestCompletedAsync"); |
93 emit m_Parent->requestCompleted(retValue); |
94 emit mParent->requestCompleted(retValue); |
94 } |
95 } |
95 |
96 |
96 void XQServiceRequest_Private::requestErrorAsync(int err) |
97 void XQServiceRequest_Private::requestErrorAsync(int err) |
97 { |
98 { |
98 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::requestErrorAsync"); |
99 XQSERVICE_DEBUG_PRINT("XQServiceRequest_Private::requestErrorAsync"); |
99 emit m_Parent->requestError(err); |
100 emit mParent->requestError(err); |
100 } |
101 } |
101 |
102 |
102 /*! |
103 /*! |
103 Construct a null service request. |
104 Construct a null service request. |
104 setService() and setMessage() must be called before send(), but the |
105 setService() and setMessage() must be called before send(), but the |
105 service may be written prior to the calls. |
106 service may be written prior to the calls. |
106 */ |
107 */ |
107 XQServiceRequest::XQServiceRequest() |
108 XQServiceRequest::XQServiceRequest() |
108 { |
109 { |
109 XQSERVICE_DEBUG_PRINT("XQServiceRequest::XQServiceRequest(1)"); |
110 XQSERVICE_DEBUG_PRINT("XQServiceRequest::XQServiceRequest(1)"); |
110 m_data = new XQServiceRequest_Private(this); |
111 mData = new XQServiceRequest_Private(this); |
111 } |
112 } |
112 |
113 |
113 /*! |
114 /*! |
114 Construct a service request that will send \a message to |
115 Construct a service request that will send \a message to |
115 a \a service when send() is called. The service may be written |
116 a \a service when send() is called. The service may be written |
117 */ |
118 */ |
118 XQServiceRequest::XQServiceRequest(const QString& service, const QString& message, const bool &synchronous) |
119 XQServiceRequest::XQServiceRequest(const QString& service, const QString& message, const bool &synchronous) |
119 { |
120 { |
120 XQSERVICE_DEBUG_PRINT("XQServiceRequest::XQServiceRequest(2)"); |
121 XQSERVICE_DEBUG_PRINT("XQServiceRequest::XQServiceRequest(2)"); |
121 XQSERVICE_DEBUG_PRINT("service: %s, message: %s, synchronous: %d", qPrintable(service), qPrintable(message), synchronous); |
122 XQSERVICE_DEBUG_PRINT("service: %s, message: %s, synchronous: %d", qPrintable(service), qPrintable(message), synchronous); |
122 m_data = new XQServiceRequest_Private(service,message,synchronous,this); |
123 mData = new XQServiceRequest_Private(service,message,synchronous,this); |
123 } |
124 } |
124 |
125 |
125 /*! |
126 /*! |
126 Copy constructor. Any data previously written to the \a orig |
127 Copy constructor. Any data previously written to the \a orig |
127 service will be in the copy. |
128 service will be in the copy. |
128 */ |
129 */ |
129 XQServiceRequest::XQServiceRequest(const XQServiceRequest& orig) |
130 XQServiceRequest::XQServiceRequest(const XQServiceRequest& orig) |
130 { |
131 { |
131 XQSERVICE_DEBUG_PRINT("XQServiceRequest::XQServiceRequest(3)"); |
132 XQSERVICE_DEBUG_PRINT("XQServiceRequest::XQServiceRequest(3)"); |
132 m_data = new XQServiceRequest_Private(orig.m_data->m_Service,orig.m_data->m_Message,orig.m_data->m_Synchronous,this); |
133 mData = new XQServiceRequest_Private(orig.mData->mService,orig.mData->mMessage,orig.mData->mSynchronous,this); |
133 m_data->m_arguments = orig.m_data->m_arguments; |
134 mData->mArguments = orig.mData->mArguments; |
134 } |
135 } |
135 |
136 |
136 /*! |
137 /*! |
137 Construct a service request by service descriptor which contains exact details of the service and interface. |
138 Construct a service request by service descriptor which contains exact details of the service and interface. |
138 a \a service when send() is called. The service may be written |
139 a \a service when send() is called. The service may be written |
156 { |
157 { |
157 XQSERVICE_DEBUG_PRINT("XQServiceRequest::operator="); |
158 XQSERVICE_DEBUG_PRINT("XQServiceRequest::operator="); |
158 if( &orig == this ) |
159 if( &orig == this ) |
159 return *this; |
160 return *this; |
160 |
161 |
161 m_data->m_Service = orig.m_data->m_Service; |
162 mData->mService = orig.mData->mService; |
162 m_data->m_Message = orig.m_data->m_Message; |
163 mData->mMessage = orig.mData->mMessage; |
163 m_data->m_arguments = orig.m_data->m_arguments; |
164 mData->mArguments = orig.mData->mArguments; |
164 m_data->m_RequestUtil = orig.m_data->m_RequestUtil; |
165 mData->mRequestUtil = orig.mData->mRequestUtil; |
165 |
166 |
166 return *this; |
167 return *this; |
167 } |
168 } |
168 |
169 |
169 /*! |
170 /*! |
170 Destructs the service request. Unlike QtopiaIpcEnvelope, the |
171 Destructs the service request. Unlike QtopiaIpcEnvelope, the |
171 request is not automatically sent. |
172 request is not automatically sent. |
172 */ |
173 */ |
173 XQServiceRequest::~XQServiceRequest() |
174 XQServiceRequest::~XQServiceRequest() |
174 { |
175 { |
175 XQSERVICE_DEBUG_PRINT("XQServiceRequest::~XQServiceRequest %s", qPrintable(m_data->m_uniqueChannelName)); |
176 XQSERVICE_DEBUG_PRINT("XQServiceRequest::~XQServiceRequest %s", qPrintable(mData->mUniqueChannelName)); |
176 XQServiceAdaptor::cancelPendingSend(m_data->m_uniqueChannelName); |
177 XQServiceAdaptor::cancelPendingSend(mData->mUniqueChannelName); |
177 delete m_data; |
178 delete mData; |
178 } |
179 } |
179 |
180 |
180 /*! |
181 /*! |
181 Returns true if either the service() or message() is not set. |
182 Returns true if either the service() or message() is not set. |
182 |
183 |
183 \sa service(), message() |
184 \sa service(), message() |
184 */ |
185 */ |
185 bool XQServiceRequest::isNull() const |
186 bool XQServiceRequest::isNull() const |
186 { |
187 { |
187 XQSERVICE_DEBUG_PRINT("XQServiceRequest::isNull"); |
188 XQSERVICE_DEBUG_PRINT("XQServiceRequest::isNull"); |
188 bool ret = m_data->m_Service.isEmpty() || m_data->m_Service.isNull() || m_data->m_Message.isNull(); |
189 bool ret = mData->mService.isEmpty() || mData->mService.isNull() || mData->mMessage.isNull(); |
189 XQSERVICE_DEBUG_PRINT("m_data->m_Service.isEmpty() = %d", m_data->m_Service.isEmpty()); |
190 XQSERVICE_DEBUG_PRINT("mData->mService.isEmpty() = %d", mData->mService.isEmpty()); |
190 XQSERVICE_DEBUG_PRINT("m_data->m_Service.isNull() = %d", m_data->m_Service.isNull()); |
191 XQSERVICE_DEBUG_PRINT("mData->mService.isNull() = %d", mData->mService.isNull()); |
191 XQSERVICE_DEBUG_PRINT("m_data->m_Message.isNull() = %d", m_data->m_Message.isNull()); |
192 XQSERVICE_DEBUG_PRINT("mData->mMessage.isNull() = %d", mData->mMessage.isNull()); |
192 XQSERVICE_DEBUG_PRINT("return %d", ret); |
193 XQSERVICE_DEBUG_PRINT("return %d", ret); |
193 return ret; |
194 return ret; |
194 } |
195 } |
195 |
196 |
196 bool XQServiceRequest::isSynchronous() const |
197 bool XQServiceRequest::isSynchronous() const |
197 { |
198 { |
198 XQSERVICE_DEBUG_PRINT("XQServiceRequest::isSynchronous"); |
199 XQSERVICE_DEBUG_PRINT("XQServiceRequest::isSynchronous"); |
199 return m_data->m_Synchronous; |
200 return mData->mSynchronous; |
200 } |
201 } |
201 |
202 |
202 void XQServiceRequest::setSynchronous(const bool& synchronous) |
203 void XQServiceRequest::setSynchronous(const bool& synchronous) |
203 { |
204 { |
204 XQSERVICE_DEBUG_PRINT("XQServiceRequest::setSynchronous"); |
205 XQSERVICE_DEBUG_PRINT("XQServiceRequest::setSynchronous"); |
205 m_data->m_Synchronous = synchronous; |
206 mData->mSynchronous = synchronous; |
206 } |
207 } |
207 /*! |
208 /*! |
208 \fn QString XQServiceRequest::send() |
209 \fn QString XQServiceRequest::send() |
209 Sends the request. Returns false if there was no application that could |
210 Sends the request. Returns false if there was no application that could |
210 service the request. |
211 service the request. |
222 service the request. |
223 service the request. |
223 */ |
224 */ |
224 bool XQServiceRequest::send(QVariant& retData) |
225 bool XQServiceRequest::send(QVariant& retData) |
225 { |
226 { |
226 XQSERVICE_DEBUG_PRINT("XQServiceRequest::send(2)"); |
227 XQSERVICE_DEBUG_PRINT("XQServiceRequest::send(2)"); |
227 if (isNull()) { |
228 if (isNull()) |
228 XQSERVICE_DEBUG_PRINT("Request is null"); |
229 { |
229 return false; |
230 XQSERVICE_DEBUG_PRINT("XQServiceRequest::send error: null request"); |
230 } |
|
231 |
|
232 if (m_data->m_Service.isNull()) |
|
233 return false; |
|
234 |
|
235 // Handle sharable file argument(s), if any |
|
236 if (!handleSharableFileArgs()) |
|
237 { |
|
238 XQService::serviceThreadData()->setLatestError(XQService::EArgumentError); |
231 XQService::serviceThreadData()->setLatestError(XQService::EArgumentError); |
239 return false; |
232 return false; |
240 } |
233 } |
241 |
234 |
242 m_data->m_RequestUtil.setSynchronous(m_data->m_Synchronous); // Ensure option is set ! |
235 // Handle sharable file argument(s), if any |
243 m_data->m_RequestUtil.mOperation = m_data->m_Message; // Save the operation name for startup |
236 if (!handleSharableFileArgs()) |
|
237 { |
|
238 XQSERVICE_DEBUG_PRINT("XQServiceRequest::send error:invalid sharable file"); |
|
239 XQService::serviceThreadData()->setLatestError(XQService::EArgumentError); |
|
240 return false; |
|
241 } |
|
242 |
|
243 mData->mRequestUtil.setSynchronous(mData->mSynchronous); // Ensure option is set ! |
|
244 mData->mRequestUtil.mOperation = mData->mMessage; // Save the operation name for startup |
244 |
245 |
245 // !!! |
246 // !!! |
246 // Add the info as extra argument to the request |
247 // Add the info as extra argument to the request |
247 // This shall be removed by the server |
248 // This shall be removed by the server |
248 // !!! |
249 // !!! |
249 addArg(qVariantFromValue(m_data->m_RequestUtil.mInfo)); |
250 addArg(qVariantFromValue(mData->mRequestUtil.mInfo)); |
250 |
251 |
251 // Pass always the util instance onwards as user data. |
252 // Pass always the util instance onwards as user data. |
252 // It can be utilized by the XQServiceManager::startServer |
253 // It can be utilized by the XQServiceManager::startServer |
253 // e.g. to optimize startup of a service server |
254 // e.g. to optimize startup of a service server |
254 |
255 |
255 // Create unique channel name to separate multiple client requests to same channel name. |
256 // Create unique channel name to separate multiple client requests to same channel name. |
256 quint32 handle = (unsigned int)m_data; |
257 quint32 handle = (unsigned int)mData; |
257 m_data->m_uniqueChannelName = QString("%1:").arg(handle) + m_data->m_Service; |
258 mData->mUniqueChannelName = QString("%1:").arg(handle) + mData->mService; |
258 XQSERVICE_DEBUG_PRINT("XQServiceRequest::send(2):uniqueChannel=%s", qPrintable(m_data->m_uniqueChannelName)); |
259 XQSERVICE_DEBUG_PRINT("XQServiceRequest::send(2):uniqueChannel=%s", qPrintable(mData->mUniqueChannelName)); |
259 return XQServiceAdaptor::send(m_data->m_uniqueChannelName, message(), m_data->m_arguments, retData, m_data->m_Synchronous,m_data, |
260 return XQServiceAdaptor::send(mData->mUniqueChannelName, message(), mData->mArguments, retData, mData->mSynchronous,mData, |
260 (const void *)&m_data->m_RequestUtil); |
261 (const void *)&mData->mRequestUtil); |
261 } |
262 } |
262 /*! |
263 /*! |
263 Sets the \a service to which the request will be sent. |
264 Sets the \a service to which the request will be sent. |
264 |
265 |
265 \sa service() |
266 \sa service() |
266 */ |
267 */ |
267 void XQServiceRequest::setService(const QString& service) |
268 void XQServiceRequest::setService(const QString& fullServiceName) |
268 { |
269 { |
269 XQSERVICE_DEBUG_PRINT("XQServiceRequest::setService"); |
270 XQSERVICE_DEBUG_PRINT("XQServiceRequest::setService"); |
270 XQSERVICE_DEBUG_PRINT("service: %s", qPrintable(service)); |
271 XQSERVICE_DEBUG_PRINT("service: %s", qPrintable(fullServiceName)); |
271 m_data->m_Service = service; |
272 mData->mService = fullServiceName; |
272 m_data->m_arguments.clear(); |
273 mData->mArguments.clear(); |
|
274 mData->mRequestUtil.mDescriptor = XQAiwInterfaceDescriptor(); // Invalid descriptor |
273 } |
275 } |
274 |
276 |
275 /*! |
277 /*! |
276 \fn QString XQServiceRequest::service() const |
278 \fn QString XQServiceRequest::service() const |
277 |
279 |
293 */ |
295 */ |
294 void XQServiceRequest::setMessage(const QString& message) |
296 void XQServiceRequest::setMessage(const QString& message) |
295 { |
297 { |
296 XQSERVICE_DEBUG_PRINT("XQServiceRequest::setMessage"); |
298 XQSERVICE_DEBUG_PRINT("XQServiceRequest::setMessage"); |
297 XQSERVICE_DEBUG_PRINT("message: %s", qPrintable(message)); |
299 XQSERVICE_DEBUG_PRINT("message: %s", qPrintable(message)); |
298 m_data->m_Message = message; |
300 mData->mMessage = message; |
299 m_data->m_arguments.clear(); |
301 mData->mArguments.clear(); |
300 } |
302 } |
301 |
303 |
302 QString XQServiceRequest::message() const |
304 QString XQServiceRequest::message() const |
303 { |
305 { |
304 XQSERVICE_DEBUG_PRINT("XQServiceRequest::message"); |
306 XQSERVICE_DEBUG_PRINT("XQServiceRequest::message"); |
305 XQSERVICE_DEBUG_PRINT("message: %s", qPrintable(m_data->m_Message)); |
307 XQSERVICE_DEBUG_PRINT("message: %s", qPrintable(mData->mMessage)); |
306 return m_data->m_Message; |
308 return mData->mMessage; |
307 } |
309 } |
308 |
310 |
309 const QList<QVariant> &XQServiceRequest::arguments() const |
311 const QList<QVariant> &XQServiceRequest::arguments() const |
310 { |
312 { |
311 XQSERVICE_DEBUG_PRINT("XQServiceRequest::arguments"); |
313 XQSERVICE_DEBUG_PRINT("XQServiceRequest::arguments"); |
312 return m_data->m_arguments; |
314 return mData->mArguments; |
313 } |
315 } |
314 |
316 |
315 void XQServiceRequest::setArguments(const QList<QVariant> &arguments) |
317 void XQServiceRequest::setArguments(const QList<QVariant> &arguments) |
316 { |
318 { |
317 XQSERVICE_DEBUG_PRINT("XQServiceRequest::setArguments"); |
319 XQSERVICE_DEBUG_PRINT("XQServiceRequest::setArguments"); |
318 m_data->m_arguments = arguments; |
320 mData->mArguments = arguments; |
319 } |
321 } |
320 |
322 |
321 int XQServiceRequest::latestError() |
323 int XQServiceRequest::latestError() |
322 { |
324 { |
323 XQSERVICE_DEBUG_PRINT("XQServiceRequest::latestError"); |
325 XQSERVICE_DEBUG_PRINT("XQServiceRequest::latestError"); |
399 bool XQServiceRequest::handleSharableFileArgs() |
401 bool XQServiceRequest::handleSharableFileArgs() |
400 { |
402 { |
401 XQSERVICE_DEBUG_PRINT("XQServiceRequest::handleSharableFile"); |
403 XQSERVICE_DEBUG_PRINT("XQServiceRequest::handleSharableFile"); |
402 |
404 |
403 bool ret = true; |
405 bool ret = true; |
404 m_data->m_RequestUtil.mSharableFileArgs.clear(); |
406 mData->mRequestUtil.mSharableFileArgs.clear(); |
405 |
407 |
406 for(int i=0; i < m_data->m_arguments.size(); i++) |
408 for(int i=0; i < mData->mArguments.size(); i++) |
407 { |
409 { |
408 if (QString(m_data->m_arguments[i].typeName()) == QString("XQSharableFile")) |
410 if (QString(mData->mArguments[i].typeName()) == QString("XQSharableFile")) |
409 { |
411 { |
410 XQSERVICE_DEBUG_PRINT("XQServiceRequest::sharable file detected"); |
412 XQSERVICE_DEBUG_PRINT("XQServiceRequest::sharable file detected"); |
411 // Pick up the sharable file(s) to utility so that no need to scan any more later |
413 // Pick up the sharable file(s) to utility so that no need to scan any more later |
412 XQSharableFile file = m_data->m_arguments[i].value<XQSharableFile>(); |
414 XQSharableFile file = mData->mArguments[i].value<XQSharableFile>(); |
413 if (!file.isValid()) |
415 if (!file.isValid()) |
414 { |
416 { |
415 // No point to pass invalid file handle onwards |
417 // No point to pass invalid file handle onwards |
416 XQSERVICE_DEBUG_PRINT("\t Invalid sharable file"); |
418 XQSERVICE_DEBUG_PRINT("\t Invalid sharable file"); |
417 ret = false; |
419 ret = false; |
418 break; |
420 break; |
419 } |
421 } |
420 if (m_data->m_RequestUtil.mSharableFileArgs.count() > 0) |
422 if (mData->mRequestUtil.mSharableFileArgs.count() > 0) |
421 { |
423 { |
422 XQSERVICE_DEBUG_PRINT("\t Too many sharable files"); |
424 XQSERVICE_DEBUG_PRINT("\t Too many sharable files"); |
423 ret = false; |
425 ret = false; |
424 break; |
426 break; |
425 } |
427 } |
426 m_data->m_RequestUtil.mSharableFileArgs.append(file); |
428 mData->mRequestUtil.mSharableFileArgs.append(file); |
427 XQSERVICE_DEBUG_PRINT("XQServiceRequest::sharable file added"); |
429 XQSERVICE_DEBUG_PRINT("XQServiceRequest::sharable file added"); |
428 } |
430 } |
429 } |
431 } |
430 |
432 |
431 if (!ret) |
433 if (!ret) |
432 { |
434 { |
433 m_data->m_RequestUtil.mSharableFileArgs.clear(); |
435 mData->mRequestUtil.mSharableFileArgs.clear(); |
434 } |
436 } |
435 |
437 |
436 return ret; |
438 return ret; |
437 } |
439 } |
438 |
440 |
458 void XQServiceRequest::deserializeArguments(XQServiceRequest &action, |
460 void XQServiceRequest::deserializeArguments(XQServiceRequest &action, |
459 const QByteArray &data) |
461 const QByteArray &data) |
460 { |
462 { |
461 XQSERVICE_DEBUG_PRINT("XQServiceRequest::deserializeArguments"); |
463 XQSERVICE_DEBUG_PRINT("XQServiceRequest::deserializeArguments"); |
462 QDataStream stream(data); |
464 QDataStream stream(data); |
463 stream >> action.m_data->m_arguments; |
465 stream >> action.mData->mArguments; |
464 } |
466 } |
465 |
467 |
466 /*! |
468 /*! |
467 \internal |
469 \internal |
468 \fn void XQServiceRequest::serialize(Stream &stream) const |
470 \fn void XQServiceRequest::serialize(Stream &stream) const |
469 */ |
471 */ |
470 template <typename Stream> void XQServiceRequest::serialize(Stream &stream) const |
472 template <typename Stream> void XQServiceRequest::serialize(Stream &stream) const |
471 { |
473 { |
472 XQSERVICE_DEBUG_PRINT("XQServiceRequest::serialize"); |
474 XQSERVICE_DEBUG_PRINT("XQServiceRequest::serialize"); |
473 stream << m_data->m_arguments; |
475 stream << mData->mArguments; |
474 stream << m_data->m_Service; |
476 stream << mData->mService; |
475 stream << m_data->m_Message; |
477 stream << mData->mMessage; |
476 stream << m_data->m_Synchronous; |
478 stream << mData->mSynchronous; |
477 } |
479 } |
478 |
480 |
479 /*! |
481 /*! |
480 \internal |
482 \internal |
481 \fn void XQServiceRequest::deserialize(Stream &stream) |
483 \fn void XQServiceRequest::deserialize(Stream &stream) |
482 */ |
484 */ |
483 template <typename Stream> void XQServiceRequest::deserialize(Stream &stream) |
485 template <typename Stream> void XQServiceRequest::deserialize(Stream &stream) |
484 { |
486 { |
485 XQSERVICE_DEBUG_PRINT("XQServiceRequest::deserialize"); |
487 XQSERVICE_DEBUG_PRINT("XQServiceRequest::deserialize"); |
486 stream >> m_data->m_arguments; |
488 stream >> mData->mArguments; |
487 stream >> m_data->m_Service; |
489 stream >> mData->mService; |
488 stream >> m_data->m_Message; |
490 stream >> mData->mMessage; |
489 stream >> m_data->m_Synchronous; |
491 stream >> mData->mSynchronous; |
490 } |
492 } |
491 |
493 |
492 Q_IMPLEMENT_USER_METATYPE(XQServiceRequest) |
494 Q_IMPLEMENT_USER_METATYPE(XQServiceRequest) |