Fixed jira issues (N_SE-33648, 33603, 33826, 33849)
authorDongseok JANG <dongseok.jang@samsung.com>
Thu, 11 Apr 2013 13:27:39 +0000 (22:27 +0900)
committerDongseok JANG <dongseok.jang@samsung.com>
Thu, 11 Apr 2013 15:01:30 +0000 (00:01 +0900)
Change-Id: I719ef56acc68d8bcc38d07475042269f9b64a1f3
Signed-off-by: Dongseok JANG <dongseok.jang@samsung.com>
src/CtContactDetailsForm.cpp
src/CtContactEditorForm.cpp
src/CtContactPresentationModel.cpp

index ab26c40..88e250c 100644 (file)
@@ -306,6 +306,7 @@ ContactDetailsForm::OnActionPerformed(const Tizen::Ui::Control& source, int acti
                {
                        __pPresentationModel->SetValue(DETAIL_PROPERTY_RINGTONE, String());
                        __pPresentationModel->UpdateContact();
+                       __pTableView->RefreshItem(__pItemList->GetCount() - 1, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
                }
                break;
        case IDA_VOICE_CALL:
@@ -420,7 +421,7 @@ ContactDetailsForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previous
 
                __pTableView->RefreshItem(__pItemList->GetCount() - 2, TABLE_VIEW_REFRESH_TYPE_ITEM_MODIFY);
        }
-       else if (previousSceneId == IDSCN_CONTACT_EDITOR && __appControlViewType.IsEmpty())
+       else if (previousSceneId == IDSCN_CONTACT_EDITOR && __appControlViewType.Equals(VALUE_VIEW_TYPE_VCF, false) == false)
        {
                InitializeDetailItemList();
                __pTableView->UpdateTableView();
@@ -601,22 +602,12 @@ ContactDetailsForm::InitializeDetailItemList(void)
                        pFooter->SetButton(BUTTON_POSITION_LEFT, footerItemMore);
                }
 
-               String otherNumber;
-               String otherNumberType;
-               String defaultNumber = __pPresentationModel->GetValue(DETAIL_PROPERTY_DEFAULT_PHONE_NUMBER);
-               String defaultNumberType = __pPresentationModel->GetType(DETAIL_PROPERTY_DEFAULT_PHONE_NUMBER);
                for (int subIndex = 0; subIndex < otherNumberCount; subIndex++)
                {
-                       //omit default number
-                       otherNumber = __pPresentationModel->GetValue(DETAIL_PROPERTY_PHONE_NUMBER, subIndex);
-                       otherNumberType = __pPresentationModel->GetType(DETAIL_PROPERTY_PHONE_NUMBER, subIndex);
-
-                       if (otherNumber.CompareTo(defaultNumber) == 0 && otherNumberType.CompareTo(defaultNumberType) == 0)
+                       if (__pPresentationModel->GetDefaultNumberIndex() != subIndex)
                        {
-                               continue;
+                               __pItemList->Add(DETAIL_PROPERTY_PHONE_NUMBER + subIndex);
                        }
-
-                       __pItemList->Add(DETAIL_PROPERTY_PHONE_NUMBER + subIndex);
                }
        }
 
index e12264f..a7be512 100644 (file)
@@ -3394,8 +3394,15 @@ CATCH:
 void
 ContactEditorForm::OnContactsChanged(void)
 {
+       SceneManager* pSceneManager = SceneManager::GetInstance();
+
        if (__isSaved == false)
        {
+               if (__pPresentationModel->IsContactRemoved())
+               {
+                       pSceneManager->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
+               }
+
                return;
        }
 
@@ -3409,7 +3416,6 @@ ContactEditorForm::OnContactsChanged(void)
        else
        {
                ArrayList* pArg = null;
-               SceneManager* pSceneManager = SceneManager::GetInstance();
 
                if (__pPresentationModel->GetVcfPath().IsEmpty() == false)
                {
index 74ae224..9dc836f 100644 (file)
@@ -1237,6 +1237,25 @@ ContactPresentationModel::OnContactsChanged(const Tizen::Base::Collection::IList
        {
                SetContactId(__pContact->GetRecordId());
        }
+       else if (__isEditing)
+       {
+               IEnumerator* pEnum = contactChangeInfoList.GetEnumeratorN();
+
+               if (pEnum != null)
+               {
+                       while (pEnum->MoveNext() == E_SUCCESS)
+                       {
+                               const ContactChangeInfo* pChangeInfo = static_cast<const ContactChangeInfo *>(pEnum->GetCurrent());
+
+                               if (pChangeInfo != null && pChangeInfo->GetChangeType() == RECORD_CHANGE_TYPE_REMOVED && __pContact->GetRecordId() == pChangeInfo->GetContactId())
+                               {
+                                       SetContactId(INVALID_RECORD_ID);
+                                       break;
+                               }
+                       }
+                       delete pEnum;
+               }
+       }
 
        IContactEventListener* pInterface = null;
        IEnumerator* pEnum = __pContactListenerList->GetEnumeratorN();