phoneapp/phoneuiqtviewadapter/src/phonenotecontroller.cpp
changeset 76 cfea66083b62
parent 65 2a5d4ab426d3
child 78 baacf668fe89
equal deleted inserted replaced
74:d1c62c765e48 76:cfea66083b62
   150                     noteParam->Text().Length()) ); 
   150                     noteParam->Text().Length()) ); 
   151             
   151             
   152             QObject::connect(m_dtmfNote, SIGNAL(aboutToClose()), 
   152             QObject::connect(m_dtmfNote, SIGNAL(aboutToClose()), 
   153                              this, SLOT(removeMappings())); 
   153                              this, SLOT(removeMappings())); 
   154             
   154             
   155             replaceDialogActions(m_dtmfNote, hbactions);
   155             // Do not delete old actions, progress dialog has
       
   156             // the ownership for the actions.
       
   157             replaceDialogActions(m_dtmfNote, hbactions, false);
   156       
   158       
   157             m_dtmfNote->show();
   159             m_dtmfNote->show();
   158         }
   160         }
   159     }
   161     }
   160 }
   162 }
   183         }
   185         }
   184     }
   186     }
   185 }
   187 }
   186 
   188 
   187 void PhoneNoteController::replaceDialogActions(
   189 void PhoneNoteController::replaceDialogActions(
   188         HbDialog *dialog, QList<HbAction *> &actions)
   190         HbDialog *dialog, 
       
   191         QList<HbAction *> &actions,
       
   192         bool deleteOldActions)
   189 {
   193 {
   190     PHONE_TRACE
   194     PHONE_TRACE
   191     // Remove default actions
   195     // Remove default actions
   192     foreach (QAction *action, dialog->actions()) {
   196     foreach (QAction *action, dialog->actions()) {
   193         dialog->removeAction(action);
   197         dialog->removeAction(action);
   194         delete action;
   198         if (deleteOldActions) {
       
   199             delete action;
       
   200         }
   195     }
   201     }
   196     
   202     
   197     // Add new actions
   203     // Add new actions
   198     foreach (HbAction *newAction, actions) {
   204     foreach (HbAction *newAction, actions) {
   199         newAction->setParent(m_queryNote);
   205         newAction->setParent(dialog);
   200         connect(newAction, SIGNAL(triggered()), m_signalMapper, SLOT(map()));
   206         connect(newAction, SIGNAL(triggered()), m_signalMapper, SLOT(map()));
   201         m_signalMapper->setMapping(newAction, newAction->data().toInt());
   207         m_signalMapper->setMapping(newAction, newAction->data().toInt());
   202         m_actions.append(newAction);
   208         m_actions.append(newAction);
   203         dialog->addAction(newAction);
   209         dialog->addAction(newAction);
   204     }
   210     }