phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp
changeset 76 cfea66083b62
parent 65 2a5d4ab426d3
child 78 baacf668fe89
--- a/phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp	Fri Sep 17 17:09:12 2010 +0300
+++ b/phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp	Mon Oct 04 16:06:10 2010 +0300
@@ -152,7 +152,9 @@
             QObject::connect(m_dtmfNote, SIGNAL(aboutToClose()), 
                              this, SLOT(removeMappings())); 
             
-            replaceDialogActions(m_dtmfNote, hbactions);
+            // Do not delete old actions, progress dialog has
+            // the ownership for the actions.
+            replaceDialogActions(m_dtmfNote, hbactions, false);
       
             m_dtmfNote->show();
         }
@@ -185,18 +187,22 @@
 }
 
 void PhoneNoteController::replaceDialogActions(
-        HbDialog *dialog, QList<HbAction *> &actions)
+        HbDialog *dialog, 
+        QList<HbAction *> &actions,
+        bool deleteOldActions)
 {
     PHONE_TRACE
     // Remove default actions
     foreach (QAction *action, dialog->actions()) {
         dialog->removeAction(action);
-        delete action;
+        if (deleteOldActions) {
+            delete action;
+        }
     }
     
     // Add new actions
     foreach (HbAction *newAction, actions) {
-        newAction->setParent(m_queryNote);
+        newAction->setParent(dialog);
         connect(newAction, SIGNAL(triggered()), m_signalMapper, SLOT(map()));
         m_signalMapper->setMapping(newAction, newAction->data().toInt());
         m_actions.append(newAction);