From 86ad0ce2a2aee8dbafc80b670a450cf1436c64b8 Mon Sep 17 00:00:00 2001 From: Keebum Kim Date: Wed, 5 Jun 2013 16:10:37 +0900 Subject: [PATCH] Modify contact sync operation. Change-Id: Iad0e530d46dcb8beaedd7cd3ca5fc5ec4c69b01d --- utils/MsgContact.cpp | 40 +++++++++++++++++----------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/utils/MsgContact.cpp b/utils/MsgContact.cpp index 5b75e67..f9533c3 100755 --- a/utils/MsgContact.cpp +++ b/utils/MsgContact.cpp @@ -454,33 +454,27 @@ bool MsgUpdateContact(int index, int type) ret = contacts_record_get_child_record_at_p(contact, _contacts_contact.name, 0, &name); if (ret != CONTACTS_ERROR_NONE) { MSG_DEBUG("contacts_record_get_child_record_at_p() Error [%d]", ret); - contacts_record_destroy(contact, true); - return false; - } - - char* strFirstName = NULL; - ret = contacts_record_get_str_p(name, _contacts_name.first, &strFirstName); - if (ret != CONTACTS_ERROR_NONE) { - MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret); - contacts_record_destroy(contact, true); - return false; - } + } else { + char* strFirstName = NULL; + ret = contacts_record_get_str_p(name, _contacts_name.first, &strFirstName); + if (ret != CONTACTS_ERROR_NONE) { + MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret); + } - char* strLastName = NULL; - ret = contacts_record_get_str_p(name, _contacts_name.last, &strLastName); - if (ret != CONTACTS_ERROR_NONE) { - MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret); - contacts_record_destroy(contact, true); - return false; - } + char* strLastName = NULL; + ret = contacts_record_get_str_p(name, _contacts_name.last, &strLastName); + if (ret != CONTACTS_ERROR_NONE) { + MSG_DEBUG("contacts_record_get_str_p() Error [%d]", ret); + } - MSG_DEBUG("First Name : [%s], Last Name : [%s]", strFirstName, strLastName); + MSG_DEBUG("First Name : [%s], Last Name : [%s]", strFirstName, strLastName); - if (strFirstName != NULL) - strncpy(contactInfo.firstName, strFirstName, MAX_DISPLAY_NAME_LEN); + if (strFirstName != NULL) + strncpy(contactInfo.firstName, strFirstName, MAX_DISPLAY_NAME_LEN); - if (strLastName != NULL) - strncpy(contactInfo.lastName, strLastName, MAX_DISPLAY_NAME_LEN); + if (strLastName != NULL) + strncpy(contactInfo.lastName, strLastName, MAX_DISPLAY_NAME_LEN); + } MsgStoClearContactInfo(&ContactDbHandle, index); -- 2.7.4