messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogwidget.cpp
--- a/messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogwidget.cpp Fri Sep 17 20:01:45 2010 +0530
+++ b/messagingapp/msgnotifications/msgnotificationdialogplugin/src/msgnotificationdialogwidget.cpp Fri Sep 17 20:16:33 2010 +0530
@@ -14,6 +14,8 @@
* Description: Widget class for Notificaiton Dialog Plugin
*
*/
+#include <QThreadPool>
+#include <QRunnable>
#include "debugtraces.h"
#include <ccsdefs.h>
@@ -42,9 +44,7 @@
// ServiceRequestSenderTask::ServiceRequestSenderTask
// @see msgnotificationdialogwidget.h
// ----------------------------------------------------------------------------
-ServiceRequestSenderTask::ServiceRequestSenderTask(qint64 conversationId,
- QObject* parent):
-QThread(parent),
+ServiceRequestSenderTask::ServiceRequestSenderTask(qint64 conversationId):
mConvId(conversationId)
{
}
@@ -81,10 +81,9 @@
args << QVariant(mConvId);
request->setArguments(args);
+ request->setSynchronous(true);
request->send();
delete request;
-
- exec();
}
void ServiceRequestSenderTask::onRequestCompleted(const QVariant& value)
@@ -92,8 +91,6 @@
Q_UNUSED(value);
serviceTaskLaunched = false;
emit serviceRequestCompleted();
-
- quit();
}
void ServiceRequestSenderTask::onRequestError(int errorCode, const QString& errorMessage)
@@ -102,8 +99,6 @@
Q_UNUSED(errorMessage);
serviceTaskLaunched = false;
emit serviceRequestCompleted();
-
- quit();
}
// ----------------------------------------------------------------------------
@@ -251,11 +246,11 @@
void MsgNotificationDialogWidget::widgetActivated()
{
ServiceRequestSenderTask* task =
- new ServiceRequestSenderTask(mConversationId,this);
+ new ServiceRequestSenderTask(mConversationId);
connect(task,SIGNAL(serviceRequestCompleted()),
this,SIGNAL(deviceDialogClosed()));
serviceTaskLaunched = true;
- task->start();
+ QThreadPool::globalInstance()->start(task);
enableTouchActivation(false);
}