phonebookui/pbkcommonui/src/cntgroupactionsview.cpp
changeset 71 7cc7d74059f9
parent 65 ae724a111993
--- a/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp	Thu Sep 02 20:16:15 2010 +0300
+++ b/phonebookui/pbkcommonui/src/cntgroupactionsview.cpp	Fri Sep 17 08:27:32 2010 +0300
@@ -277,32 +277,37 @@
 {
     Q_UNUSED(contact);
     
-    if (action.compare("message", Qt::CaseInsensitive) == 0) {
+    if (action.compare("message", Qt::CaseInsensitive) == 0)
+    {
         QContactPhoneNumber phoneNumber = static_cast<QContactPhoneNumber>(detail);
         mMessageActionParams.insert(phoneNumber.number(),QVariant(contact.displayLabel()));
     }
-    else if (action.compare("email", Qt::CaseInsensitive) == 0) {
+    else if (action.compare("email", Qt::CaseInsensitive) == 0)
+    {
         QContactEmailAddress email = static_cast<QContactEmailAddress>(detail);
         mEmailActionParams.append(email.emailAddress());
     }
     
     //actionpopup executed, decrement counter
     mPopupCount--;
-    if (mPopupCount==0) {
+    if (mPopupCount==0)
+    {
         QVariantMap map;
         QVariant params;
-        if (action.compare("message", Qt::CaseInsensitive) == 0) {
+        if (action.compare("message", Qt::CaseInsensitive) == 0)
+        {
             params.setValue(mMessageActionParams);
         }
-        else if (action.compare("email", Qt::CaseInsensitive) == 0) {
+        else if (action.compare("email", Qt::CaseInsensitive) == 0)
+        {
             params.setValue(mEmailActionParams);
         }
         map.insert(action,params);
-        
+
         CntActionLauncher* other = new CntActionLauncher( mEngine->contactManager(SYMBIAN_BACKEND), action);
         connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*)));
         other->execute(*mGroupContact, QContactDetail(), map);
-        }
+    }
 }
 
 bool CntGroupActionsView::eventFilter(QObject *obj, QEvent *event)
@@ -354,6 +359,32 @@
 {
     //actionpopup cancelled, decrement counter
     mPopupCount--;
+    
+    if (mPopupCount==0)
+    {
+        QVariantMap map;
+        QVariant params;
+        QString action;
+        if (mMessageActionParams.count())
+        {
+            params.setValue(mMessageActionParams);
+            action = "message";
+        }
+        else if (mEmailActionParams.count())
+        {
+            params.setValue(mEmailActionParams);
+            action = "email";
+        }
+        else
+        {
+            return;
+        }
+        map.insert(action,params);
+
+        CntActionLauncher* other = new CntActionLauncher( mEngine->contactManager(SYMBIAN_BACKEND), action);
+        connect(other, SIGNAL(actionExecuted(CntActionLauncher*)), this, SLOT(actionExecuted(CntActionLauncher*)));
+        other->execute(*mGroupContact, QContactDetail(), map);
+    }
 }