phonebookui/pbkcommonui/src/cntdetaileditor.cpp
changeset 37 fd64c38c277d
parent 31 2a11b5b00470
child 40 b46a585f6909
equal deleted inserted replaced
31:2a11b5b00470 37:fd64c38c277d
    88     
    88     
    89     if ( mView->navigationAction() != mSoftkey) {
    89     if ( mView->navigationAction() != mSoftkey) {
    90         mView->setNavigationAction(mSoftkey);
    90         mView->setNavigationAction(mSoftkey);
    91     }
    91     }
    92     
    92     
    93     QContact selectedContact = aArgs.value(ESelectedContact).value<QContact>();
    93     QContact selectedContact;
       
    94     if ( mId == groupEditorView )
       
    95     {
       
    96         selectedContact = aArgs.value(ESelectedGroupContact).value<QContact>();
       
    97         connect( mDataForm, SIGNAL(itemShown(const QModelIndex&)), this, SLOT(handleItemShown(const QModelIndex&)) );
       
    98 
       
    99     }
       
   100     else
       
   101     {
       
   102         selectedContact = aArgs.value(ESelectedContact).value<QContact>();
       
   103     }
    94     mEditorFactory->setupEditorView(*this, selectedContact);
   104     mEditorFactory->setupEditorView(*this, selectedContact);
    95     
   105     
    96     mDataForm->setItemRecycling(true);
   106     mDataForm->setItemRecycling(true);
    97 
   107 
    98     // add new field if required
   108     // add new field if required
    99     if ( aArgs.value(ESelectedAction).toString() == "add" ) {
   109     if ( aArgs.value(ESelectedAction).toString() == "add" )
       
   110     {
   100         mDataFormModel->insertDetailField();
   111         mDataFormModel->insertDetailField();
   101     }
       
   102     
       
   103     if ( mId == groupEditorView )
       
   104     {
       
   105         connect( mDataForm, SIGNAL(itemShown(const QModelIndex&)), this, SLOT(handleItemShown(const QModelIndex&)) );
       
   106     }
   112     }
   107 }
   113 }
   108 
   114 
   109 void CntDetailEditor::deactivate()
   115 void CntDetailEditor::deactivate()
   110 {
   116 {
   166     mDataFormModel->saveContactDetails();
   172     mDataFormModel->saveContactDetails();
   167     
   173     
   168     QContact selected( *mDataFormModel->contact() );
   174     QContact selected( *mDataFormModel->contact() );
   169     QVariant var;
   175     QVariant var;
   170     var.setValue(selected);
   176     var.setValue(selected);
   171     mArgs.insert(ESelectedContact, var);
   177     if ( mId == groupEditorView )
       
   178     {
       
   179        mArgs.insert(ESelectedGroupContact, var);
       
   180     }
       
   181     else
       
   182     {
       
   183         mArgs.insert(ESelectedContact, var);
       
   184     }
       
   185     
   172     mViewManager->back( mArgs );
   186     mViewManager->back( mArgs );
   173 }
   187 }
   174 
   188 
   175 void CntDetailEditor::setHeader(QString aHeader)
   189 void CntDetailEditor::setHeader(QString aHeader)
   176 {
   190 {