40 |
42 |
41 // ---------------------------------------------------------------------------- |
43 // ---------------------------------------------------------------------------- |
42 // ServiceRequestSenderTask::ServiceRequestSenderTask |
44 // ServiceRequestSenderTask::ServiceRequestSenderTask |
43 // @see msgnotificationdialogwidget.h |
45 // @see msgnotificationdialogwidget.h |
44 // ---------------------------------------------------------------------------- |
46 // ---------------------------------------------------------------------------- |
45 ServiceRequestSenderTask::ServiceRequestSenderTask(qint64 conversationId, |
47 ServiceRequestSenderTask::ServiceRequestSenderTask(qint64 conversationId): |
46 QObject* parent): |
|
47 QThread(parent), |
|
48 mConvId(conversationId) |
48 mConvId(conversationId) |
49 { |
49 { |
50 } |
50 } |
51 |
51 |
52 // ---------------------------------------------------------------------------- |
52 // ---------------------------------------------------------------------------- |
79 connect(request,SIGNAL(requestError(int, const QString&)), |
79 connect(request,SIGNAL(requestError(int, const QString&)), |
80 this,SLOT(onRequestError(int, const QString&))); |
80 this,SLOT(onRequestError(int, const QString&))); |
81 |
81 |
82 args << QVariant(mConvId); |
82 args << QVariant(mConvId); |
83 request->setArguments(args); |
83 request->setArguments(args); |
|
84 request->setSynchronous(true); |
84 request->send(); |
85 request->send(); |
85 delete request; |
86 delete request; |
86 |
|
87 exec(); |
|
88 } |
87 } |
89 |
88 |
90 void ServiceRequestSenderTask::onRequestCompleted(const QVariant& value) |
89 void ServiceRequestSenderTask::onRequestCompleted(const QVariant& value) |
91 { |
90 { |
92 Q_UNUSED(value); |
91 Q_UNUSED(value); |
93 serviceTaskLaunched = false; |
92 serviceTaskLaunched = false; |
94 emit serviceRequestCompleted(); |
93 emit serviceRequestCompleted(); |
95 |
|
96 quit(); |
|
97 } |
94 } |
98 |
95 |
99 void ServiceRequestSenderTask::onRequestError(int errorCode, const QString& errorMessage) |
96 void ServiceRequestSenderTask::onRequestError(int errorCode, const QString& errorMessage) |
100 { |
97 { |
101 Q_UNUSED(errorCode); |
98 Q_UNUSED(errorCode); |
102 Q_UNUSED(errorMessage); |
99 Q_UNUSED(errorMessage); |
103 serviceTaskLaunched = false; |
100 serviceTaskLaunched = false; |
104 emit serviceRequestCompleted(); |
101 emit serviceRequestCompleted(); |
105 |
|
106 quit(); |
|
107 } |
102 } |
108 |
103 |
109 // ---------------------------------------------------------------------------- |
104 // ---------------------------------------------------------------------------- |
110 // MsgNotificationDialogWidget::MsgNotificationDialogWidget |
105 // MsgNotificationDialogWidget::MsgNotificationDialogWidget |
111 // @see msgnotificationdialogwidget.h |
106 // @see msgnotificationdialogwidget.h |
249 // @see msgnotificationdialogwidget.h |
244 // @see msgnotificationdialogwidget.h |
250 // ---------------------------------------------------------------------------- |
245 // ---------------------------------------------------------------------------- |
251 void MsgNotificationDialogWidget::widgetActivated() |
246 void MsgNotificationDialogWidget::widgetActivated() |
252 { |
247 { |
253 ServiceRequestSenderTask* task = |
248 ServiceRequestSenderTask* task = |
254 new ServiceRequestSenderTask(mConversationId,this); |
249 new ServiceRequestSenderTask(mConversationId); |
255 connect(task,SIGNAL(serviceRequestCompleted()), |
250 connect(task,SIGNAL(serviceRequestCompleted()), |
256 this,SIGNAL(deviceDialogClosed())); |
251 this,SIGNAL(deviceDialogClosed())); |
257 serviceTaskLaunched = true; |
252 serviceTaskLaunched = true; |
258 task->start(); |
253 QThreadPool::globalInstance()->start(task); |
259 enableTouchActivation(false); |
254 enableTouchActivation(false); |
260 |
255 |
261 } |
256 } |
262 |
257 |
263 // ---------------------------------------------------------------------------- |
258 // ---------------------------------------------------------------------------- |