diff options
Diffstat (limited to 'src/platform/Tizen/Contact/ContactObjectP2AConverter.cpp')
-rw-r--r-- | src/platform/Tizen/Contact/ContactObjectP2AConverter.cpp | 120 |
1 files changed, 62 insertions, 58 deletions
diff --git a/src/platform/Tizen/Contact/ContactObjectP2AConverter.cpp b/src/platform/Tizen/Contact/ContactObjectP2AConverter.cpp index dbdbf4d..f43d19a 100644 --- a/src/platform/Tizen/Contact/ContactObjectP2AConverter.cpp +++ b/src/platform/Tizen/Contact/ContactObjectP2AConverter.cpp @@ -100,7 +100,7 @@ void ContactObjectP2AConverter::convertToAbstractObject() exportBaseInfoValue(); exportNameValue(); exportCompanyValue(); - exportNoteValue(); +// exportNoteValue(); exportNumberList(); exportEmailList(); exportGrouprelList(); @@ -154,21 +154,13 @@ void ContactObjectP2AConverter::exportBaseInfoValue() m_abstractContact->unsetRingtoneURI(); } - if(!m_forScratch) + charValue = contacts_svc_value_get_str(ctsValue, CTS_BASE_VAL_NOTE_STR); + if (charValue) + m_abstractContact->setNote(charValue); + else { - charValue = contacts_svc_value_get_str(ctsValue, CTS_BASE_VAL_DISPLAY_NAME_STR); - if (charValue) - { - ContactNamePtr contactName = m_abstractContact->getName(); - if(contactName == NULL) - { - contactName = ContactNamePtr(new ContactName()); - m_abstractContact->setName(contactName); - } - contactName->setDisplayName(charValue); - } -// else -// ThrowMsg(UnknownException, "converting base data (no display name)"); + if(m_abstractContact->getNoteIsSet()) + m_abstractContact->unsetNote(); } } @@ -204,6 +196,9 @@ void ContactObjectP2AConverter::exportNameValue() if(contactName->getPhoneticLastNameIsSet()) contactName->unsetPhoneticLastName(); + + if(contactName->getDisplayNameIsSet()) + contactName->unsetDisplayName(); } return; } @@ -253,23 +248,32 @@ void ContactObjectP2AConverter::exportNameValue() contactName->unsetPrefix(); } - charValue = contacts_svc_value_get_str(ctsValue, CTS_NAME_VAL_PHONETIC_FIRST_STR); + charValue = contacts_svc_value_get_str(ctsValue, CTS_NAME_VAL_DISPLAY_STR); if (charValue) - contactName->setPhoneticFirstName(charValue); + contactName->setDisplayName(charValue); else { - if(contactName->getPhoneticFirstNameIsSet()) - contactName->unsetPhoneticFirstName(); + if(contactName->getDisplayNameIsSet()) + contactName->unsetDisplayName(); } - charValue = contacts_svc_value_get_str(ctsValue, CTS_NAME_VAL_PHONETIC_LAST_STR); - if (charValue) - contactName->setPhoneticLastName(charValue); - else - { - if(contactName->getPhoneticLastNameIsSet()) - contactName->unsetPhoneticLastName(); - } +// charValue = contacts_svc_value_get_str(ctsValue, CTS_NAME_VAL_PHONETIC_NAME_STR); +// if (charValue) +// contactName->setPhoneticFirstName(charValue); +// else +// { +// if(contactName->getPhoneticFirstNameIsSet()) +// contactName->unsetPhoneticFirstName(); +// } +// +// charValue = contacts_svc_value_get_str(ctsValue, CTS_NAME_VAL_PHONETIC_LAST_STR); +// if (charValue) +// contactName->setPhoneticLastName(charValue); +// else +// { +// if(contactName->getPhoneticLastNameIsSet()) +// contactName->unsetPhoneticLastName(); +// } } @@ -348,37 +352,37 @@ void ContactObjectP2AConverter::exportCompanyValue() organization->unsetLogoURI(); } -void ContactObjectP2AConverter::exportNoteValue() -{ - int errorCode = 0; - CTSvalue *ctsValue = NULL; - - errorCode = contacts_svc_struct_get_value(m_platformContact, CTS_CF_NOTE_VALUE, &ctsValue); - if(errorCode != CTS_SUCCESS && errorCode != CTS_ERR_NO_DATA) - ThrowMsg(UnknownException, "getting note value : (err:" << errorCode << ")"); - - if(ctsValue == NULL || errorCode == CTS_ERR_NO_DATA) - { - //LogDebug("Platform contact don't have note value"); - if(m_abstractContact->getNoteIsSet()) - m_abstractContact->unsetNote(); - - return; - } - - bool boolValue = false; - const char *charValue = NULL; - - boolValue = contacts_svc_value_get_bool(ctsValue, CTS_NOTE_VAL_DELETE_BOOL); - charValue = contacts_svc_value_get_str(ctsValue, CTS_COMPANY_VAL_NAME_STR); - if (charValue && boolValue != false) - m_abstractContact->setNote(charValue); - else - { - if(m_abstractContact->getNoteIsSet()) - m_abstractContact->unsetNote(); - } -} +//void ContactObjectP2AConverter::exportNoteValue() +//{ +// int errorCode = 0; +// CTSvalue *ctsValue = NULL; +// +// errorCode = contacts_svc_struct_get_value(m_platformContact, CTS_CF_NOTE_VALUE, &ctsValue); +// if(errorCode != CTS_SUCCESS && errorCode != CTS_ERR_NO_DATA) +// ThrowMsg(UnknownException, "getting note value : (err:" << errorCode << ")"); +// +// if(ctsValue == NULL || errorCode == CTS_ERR_NO_DATA) +// { +// //LogDebug("Platform contact don't have note value"); +// if(m_abstractContact->getNoteIsSet()) +// m_abstractContact->unsetNote(); +// +// return; +// } +// +// bool boolValue = false; +// const char *charValue = NULL; +// +// boolValue = contacts_svc_value_get_bool(ctsValue, CTS_NOTE_VAL_DELETE_BOOL); +// charValue = contacts_svc_value_get_str(ctsValue, CTS_COMPANY_VAL_NAME_STR); +// if (charValue && boolValue != false) +// m_abstractContact->setNote(charValue); +// else +// { +// if(m_abstractContact->getNoteIsSet()) +// m_abstractContact->unsetNote(); +// } +//} void ContactObjectP2AConverter::exportNumberList() { |