From c2a9c26701925ba77dc5b0d451a3804b5dff7802 Mon Sep 17 00:00:00 2001 From: Taehee Lee Date: Sat, 25 Aug 2012 13:29:08 +0900 Subject: [PATCH] Fix build breaks in contact Sync with internal branch --- src/platform/API/Mediacontent/IEventBrowseFolder.h | 12 +- .../API/Mediacontent/MediacontentImage.cpp | 2 - .../Tizen/Contact/ContactObjectA2PConverter.cpp | 455 ++++++++++++--------- .../Tizen/Contact/ContactObjectA2PConverter.h | 6 +- .../Tizen/Contact/ContactObjectP2AConverter.cpp | 120 +++--- .../Tizen/Contact/ContactObjectP2AConverter.h | 2 +- .../Tizen/Contact/query-svc/query-service.h | 8 +- src/platform/Tizen/Contact/query-svc/query-svc.c | 158 +------ src/platform/Tizen/Contact/query-svc/query-type.h | 13 +- .../Tizen/Contact/query-svc/query-utility.c | 88 ++-- .../Tizen/Contact/query-svc/query-utility.h | 13 +- .../Tizen/Mediacontent/MediaSearchVisitor.cpp | 2 +- src/platform/Tizen/Mediacontent/Mediacontent.cpp | 4 +- src/standards/Tizen/Mediacontent/JSMedia.cpp | 1 + .../Tizen/Mediacontent/JSMediacontent.cpp | 10 +- 15 files changed, 425 insertions(+), 469 deletions(-) diff --git a/src/platform/API/Mediacontent/IEventBrowseFolder.h b/src/platform/API/Mediacontent/IEventBrowseFolder.h index 4f8c8aa..9f26484 100755 --- a/src/platform/API/Mediacontent/IEventBrowseFolder.h +++ b/src/platform/API/Mediacontent/IEventBrowseFolder.h @@ -63,12 +63,12 @@ class IEventBrowseFolder : public WrtDeviceApis::Commons::IEventgetPhotoURI()); if(oldValueStr != NULL && (!m_abstractContact->getPhotoURIIsSet() || m_abstractContact->getPhotoURI().empty())) @@ -173,7 +173,7 @@ void ContactObjectA2PConverter::importBaseInfoValueToExistingValue(CTSvalue *cts if(newValueStr != NULL) { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_BASE_VAL_IMAGE_PATH_STR, newValueStr); + errorCode = contacts_svc_value_set_str(ctsValue, CTS_BASE_VAL_IMG_PATH_STR, newValueStr); if(errorCode != CTS_SUCCESS) { contacts_svc_value_free(ctsValue); @@ -206,6 +206,30 @@ void ContactObjectA2PConverter::importBaseInfoValueToExistingValue(CTSvalue *cts errorCode << ", str:" << abstractValueStr << ")"); } } + + // Contact.note + newValueStr = NULL; + oldValueStr = contacts_svc_value_get_str(ctsValue, CTS_BASE_VAL_NOTE_STR); + abstractValueStr = m_abstractContact->getNote(); + if(oldValueStr != NULL && (!m_abstractContact->getNoteIsSet() || abstractValueStr.empty()) ) + { + newValueStr = EMPTY_STRING; + } + else if(oldValueStr == NULL || abstractValueStr != oldValueStr) + { + newValueStr = abstractValueStr.c_str(); + } + + if(newValueStr != NULL) + { + errorCode = contacts_svc_value_set_str(ctsValue, CTS_BASE_VAL_NOTE_STR, newValueStr); + if(errorCode != CTS_SUCCESS) + { + contacts_svc_value_free(ctsValue); + ThrowMsg(PlatformException, "importing note E (err:" << + errorCode << ", str:" << newValueStr << ")"); + } + } } void ContactObjectA2PConverter::importBaseInfoValueToNewValue(CTSvalue *ctsValue) @@ -218,7 +242,7 @@ void ContactObjectA2PConverter::importBaseInfoValueToNewValue(CTSvalue *ctsValue string photoURI = ContactUtility::convertUriToPath(m_abstractContact->getPhotoURI()); if(!photoURI.empty()) { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_BASE_VAL_IMAGE_PATH_STR, photoURI.c_str()); + errorCode = contacts_svc_value_set_str(ctsValue, CTS_BASE_VAL_IMG_PATH_STR, photoURI.c_str()); if(errorCode != CTS_SUCCESS) { contacts_svc_value_free(ctsValue); @@ -243,6 +267,22 @@ void ContactObjectA2PConverter::importBaseInfoValueToNewValue(CTSvalue *ctsValue } } } + + // Contact.note + if(m_abstractContact->getNoteIsSet()) + { + string note = m_abstractContact->getNote(); + if(note != EMPTY_STRING) + { + errorCode = contacts_svc_value_set_str(ctsValue, CTS_BASE_VAL_NOTE_STR, note.c_str()); + if(errorCode != CTS_SUCCESS) + { + contacts_svc_value_free(ctsValue); + ThrowMsg(PlatformException, "importing note N (err:" << + errorCode << ", str:" << note << ")"); + } + } + } } void ContactObjectA2PConverter::importNameValue() @@ -255,9 +295,10 @@ void ContactObjectA2PConverter::importNameValue() (( !contactName->getFirstNameIsSet() || contactName->getFirstName().empty() ) && ( !contactName->getLastNameIsSet() || contactName->getLastName().empty() ) && ( !contactName->getMiddleNameIsSet() || contactName->getMiddleName().empty() ) - && ( !contactName->getPhoneticFirstNameIsSet() || contactName->getPhoneticFirstName().empty() ) - && ( !contactName->getPhoneticLastNameIsSet() || contactName->getPhoneticLastName().empty() ) - && ( !contactName->getPrefixIsSet() || contactName->getPrefix().empty() ) ) ) +// && ( !contactName->getPhoneticFirstNameIsSet() || contactName->getPhoneticFirstName().empty() ) +// && ( !contactName->getPhoneticLastNameIsSet() || contactName->getPhoneticLastName().empty() ) + && ( !contactName->getPrefixIsSet() || contactName->getPrefix().empty() ) + && ( !contactName->getDisplayNameIsSet() || contactName->getDisplayName().empty() ) ) ) { ctsValue = contacts_svc_value_new(CTS_VALUE_NAME); if(ctsValue == NULL) @@ -387,35 +428,59 @@ void ContactObjectA2PConverter::importNameValueToExistingValue(CTSvalue *ctsValu } } - // ContactName.phoneticFirstName - newValueStr = NULL; - oldValueStr = contacts_svc_value_get_str(ctsValue, CTS_NAME_VAL_PHONETIC_FIRST_STR); - abstractValueStr = contactName->getPhoneticFirstName(); - if(oldValueStr != NULL && (!contactName->getPhoneticFirstNameIsSet() || abstractValueStr.empty()) ) - { - newValueStr = EMPTY_STRING; - } - else if(oldValueStr == NULL || abstractValueStr != oldValueStr) - { - newValueStr = abstractValueStr.c_str(); - } - - if(newValueStr != NULL) - { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_NAME_VAL_PHONETIC_FIRST_STR, newValueStr); - if(errorCode != CTS_SUCCESS) - { - contacts_svc_value_free(ctsValue); - ThrowMsg(PlatformException, "importing phoneticFirstName E (err:" << - errorCode << ", str:" << newValueStr << ")"); - } - } - - // ContactName.phoneticLastName +// // ContactName.phoneticFirstName +// newValueStr = NULL; +// oldValueStr = contacts_svc_value_get_str(ctsValue, CTS_NAME_VAL_PHONETIC_FIRST_STR); +// abstractValueStr = contactName->getPhoneticFirstName(); +// if(oldValueStr != NULL && (!contactName->getPhoneticFirstNameIsSet() || abstractValueStr.empty()) ) +// { +// newValueStr = EMPTY_STRING; +// } +// else if(oldValueStr == NULL || abstractValueStr != oldValueStr) +// { +// newValueStr = abstractValueStr.c_str(); +// } +// +// if(newValueStr != NULL) +// { +// errorCode = contacts_svc_value_set_str(ctsValue, CTS_NAME_VAL_PHONETIC_FIRST_STR, newValueStr); +// if(errorCode != CTS_SUCCESS) +// { +// contacts_svc_value_free(ctsValue); +// ThrowMsg(PlatformException, "importing phoneticFirstName E (err:" << +// errorCode << ", str:" << newValueStr << ")"); +// } +// } +// +// // ContactName.phoneticLastName +// newValueStr = NULL; +// oldValueStr = contacts_svc_value_get_str(ctsValue, CTS_NAME_VAL_PHONETIC_LAST_STR); +// abstractValueStr = contactName->getPhoneticLastName(); +// if(oldValueStr != NULL && (!contactName->getPhoneticLastNameIsSet() || abstractValueStr.empty()) ) +// { +// newValueStr = EMPTY_STRING; +// } +// else if(oldValueStr == NULL || abstractValueStr != oldValueStr) +// { +// newValueStr = abstractValueStr.c_str(); +// } +// +// if(newValueStr != NULL) +// { +// errorCode = contacts_svc_value_set_str(ctsValue, CTS_NAME_VAL_PHONETIC_LAST_STR, newValueStr); +// if(errorCode != CTS_SUCCESS) +// { +// contacts_svc_value_free(ctsValue); +// ThrowMsg(PlatformException, "importing phoneticLastName E (err:" << +// errorCode << ", str:" << newValueStr << ")"); +// } +// } + + // ContactName.displayName newValueStr = NULL; - oldValueStr = contacts_svc_value_get_str(ctsValue, CTS_NAME_VAL_PHONETIC_LAST_STR); - abstractValueStr = contactName->getPhoneticLastName(); - if(oldValueStr != NULL && (!contactName->getPhoneticLastNameIsSet() || abstractValueStr.empty()) ) + oldValueStr = contacts_svc_value_get_str(ctsValue, CTS_NAME_VAL_DISPLAY_STR); + abstractValueStr = contactName->getDisplayName(); + if(oldValueStr != NULL && (!contactName->getDisplayNameIsSet() || abstractValueStr.empty()) ) { newValueStr = EMPTY_STRING; } @@ -426,11 +491,11 @@ void ContactObjectA2PConverter::importNameValueToExistingValue(CTSvalue *ctsValu if(newValueStr != NULL) { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_NAME_VAL_PHONETIC_LAST_STR, newValueStr); + errorCode = contacts_svc_value_set_str(ctsValue, CTS_NAME_VAL_DISPLAY_STR, newValueStr); if(errorCode != CTS_SUCCESS) { contacts_svc_value_free(ctsValue); - ThrowMsg(PlatformException, "importing phoneticLastName E (err:" << + ThrowMsg(PlatformException, "importing displayName E (err:" << errorCode << ", str:" << newValueStr << ")"); } } @@ -504,34 +569,50 @@ void ContactObjectA2PConverter::importNameValueToNewValue(CTSvalue *ctsValue, Co } } - // ContactName.phoneticFirstName - if(contactName->getPhoneticFirstNameIsSet()) - { - string phoneticFirstName = contactName->getPhoneticFirstName(); - if(phoneticFirstName != EMPTY_STRING) - { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_NAME_VAL_PHONETIC_FIRST_STR, phoneticFirstName.c_str()); - if(errorCode != CTS_SUCCESS) - { - contacts_svc_value_free(ctsValue); - ThrowMsg(PlatformException, "importing phoneticFirstName N (err:" << - errorCode << ", str:" << phoneticFirstName << ")"); - } - } - } - - // ContactName.phoneticLastName - if(contactName->getPhoneticLastNameIsSet()) - { - string phoneticLastName = contactName->getPhoneticLastName(); - if(phoneticLastName != EMPTY_STRING) - { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_NAME_VAL_PHONETIC_LAST_STR, phoneticLastName.c_str()); +// // ContactName.phoneticFirstName +// if(contactName->getPhoneticFirstNameIsSet()) +// { +// string phoneticFirstName = contactName->getPhoneticFirstName(); +// if(phoneticFirstName != EMPTY_STRING) +// { +// errorCode = contacts_svc_value_set_str(ctsValue, CTS_NAME_VAL_PHONETIC_FIRST_STR, phoneticFirstName.c_str()); +// if(errorCode != CTS_SUCCESS) +// { +// contacts_svc_value_free(ctsValue); +// ThrowMsg(PlatformException, "importing phoneticFirstName N (err:" << +// errorCode << ", str:" << phoneticFirstName << ")"); +// } +// } +// } +// +// // ContactName.phoneticLastName +// if(contactName->getPhoneticLastNameIsSet()) +// { +// string phoneticLastName = contactName->getPhoneticLastName(); +// if(phoneticLastName != EMPTY_STRING) +// { +// errorCode = contacts_svc_value_set_str(ctsValue, CTS_NAME_VAL_PHONETIC_LAST_STR, phoneticLastName.c_str()); +// if(errorCode != CTS_SUCCESS) +// { +// contacts_svc_value_free(ctsValue); +// ThrowMsg(PlatformException, "importing phoneticLastName N (err:" << +// errorCode << ", str:" << phoneticLastName << ")"); +// } +// } +// } + + // ContactName.displayName + if(contactName->getDisplayNameIsSet()) + { + string displayName = contactName->getDisplayName(); + if(displayName != EMPTY_STRING) + { + errorCode = contacts_svc_value_set_str(ctsValue, CTS_NAME_VAL_DISPLAY_STR, displayName.c_str()); if(errorCode != CTS_SUCCESS) { contacts_svc_value_free(ctsValue); - ThrowMsg(PlatformException, "importing phoneticLastName N (err:" << - errorCode << ", str:" << phoneticLastName << ")"); + ThrowMsg(PlatformException, "importing displayName N (err:" << + errorCode << ", str:" << displayName << ")"); } } } @@ -748,79 +829,79 @@ void ContactObjectA2PConverter::importCompanyValueToNewValue(CTSvalue *ctsValue, } } -void ContactObjectA2PConverter::importNoteValue() -{ - int errorCode = 0; - CTSvalue *ctsValue = NULL; - - errorCode = contacts_svc_struct_get_value(m_platformContact, CTS_CF_NOTE_VALUE, &ctsValue); - if(errorCode != CTS_SUCCESS || ctsValue == NULL) - { - ctsValue = contacts_svc_value_new(CTS_VALUE_NOTE); - if(ctsValue == NULL) - ThrowMsg(UnknownException, "creating note value (ctsValue:NULL)"); - - importNoteValueToNewValue(ctsValue); - } - else - { - importNoteValueToExistingValue(ctsValue); - } - - contacts_svc_struct_store_value(m_platformContact, CTS_CF_NOTE_VALUE, ctsValue); - contacts_svc_value_free(ctsValue); -} - -void ContactObjectA2PConverter::importNoteValueToExistingValue(CTSvalue *ctsValue) -{ - int errorCode = 0; - - const char *newValueStr = NULL; - const char *oldValueStr = NULL; - - // note - oldValueStr = contacts_svc_value_get_str(ctsValue, CTS_NOTE_VAL_NOTE_STR); - string note = m_abstractContact->getNote(); - if(oldValueStr != NULL && (!m_abstractContact->getNoteIsSet() || note.empty()) ) - { - newValueStr = EMPTY_STRING; - } - else if(oldValueStr == NULL || note != oldValueStr) - { - newValueStr = note.c_str(); - } - - if(newValueStr != NULL) - { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_NOTE_VAL_NOTE_STR, newValueStr); - if(errorCode != CTS_SUCCESS) - { - contacts_svc_value_free(ctsValue); - ThrowMsg(PlatformException, "importing note E (err:" << - errorCode << ", str:" << newValueStr << ")"); - } - } -} - -void ContactObjectA2PConverter::importNoteValueToNewValue(CTSvalue *ctsValue) -{ - int errorCode = 0; - - if(m_abstractContact->getNoteIsSet()) - { - string note = m_abstractContact->getNote(); - if(!note.empty()) - { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_NOTE_VAL_NOTE_STR, note.c_str()); - if(errorCode != CTS_SUCCESS) - { - contacts_svc_value_free(ctsValue); - ThrowMsg(PlatformException, "importing note N (err:" << - errorCode << ", str:" << note << ")"); - } - } - } -} +//void ContactObjectA2PConverter::importNoteValue() +//{ +// int errorCode = 0; +// CTSvalue *ctsValue = NULL; +// +// errorCode = contacts_svc_struct_get_value(m_platformContact, CTS_CF_NOTE_VALUE, &ctsValue); +// if(errorCode != CTS_SUCCESS || ctsValue == NULL) +// { +// ctsValue = contacts_svc_value_new(CTS_VALUE_NOTE); +// if(ctsValue == NULL) +// ThrowMsg(UnknownException, "creating note value (ctsValue:NULL)"); +// +// importNoteValueToNewValue(ctsValue); +// } +// else +// { +// importNoteValueToExistingValue(ctsValue); +// } +// +// contacts_svc_struct_store_value(m_platformContact, CTS_CF_NOTE_VALUE, ctsValue); +// contacts_svc_value_free(ctsValue); +//} +// +//void ContactObjectA2PConverter::importNoteValueToExistingValue(CTSvalue *ctsValue) +//{ +// int errorCode = 0; +// +// const char *newValueStr = NULL; +// const char *oldValueStr = NULL; +// +// // note +// oldValueStr = contacts_svc_value_get_str(ctsValue, CTS_NOTE_VAL_NOTE_STR); +// string note = m_abstractContact->getNote(); +// if(oldValueStr != NULL && (!m_abstractContact->getNoteIsSet() || note.empty()) ) +// { +// newValueStr = EMPTY_STRING; +// } +// else if(oldValueStr == NULL || note != oldValueStr) +// { +// newValueStr = note.c_str(); +// } +// +// if(newValueStr != NULL) +// { +// errorCode = contacts_svc_value_set_str(ctsValue, CTS_NOTE_VAL_NOTE_STR, newValueStr); +// if(errorCode != CTS_SUCCESS) +// { +// contacts_svc_value_free(ctsValue); +// ThrowMsg(PlatformException, "importing note E (err:" << +// errorCode << ", str:" << newValueStr << ")"); +// } +// } +//} +// +//void ContactObjectA2PConverter::importNoteValueToNewValue(CTSvalue *ctsValue) +//{ +// int errorCode = 0; +// +// if(m_abstractContact->getNoteIsSet()) +// { +// string note = m_abstractContact->getNote(); +// if(!note.empty()) +// { +// errorCode = contacts_svc_value_set_str(ctsValue, CTS_NOTE_VAL_NOTE_STR, note.c_str()); +// if(errorCode != CTS_SUCCESS) +// { +// contacts_svc_value_free(ctsValue); +// ThrowMsg(PlatformException, "importing note N (err:" << +// errorCode << ", str:" << note << ")"); +// } +// } +// } +//} void ContactObjectA2PConverter::importNumberList() { @@ -940,16 +1021,16 @@ void ContactObjectA2PConverter::importNumberList() continue; } - if(ctsStrCustomType != NULL) - { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_NUM_VAL_LABEL_STR, ctsStrCustomType); - if(errorCode != CTS_SUCCESS) - { - LogWarning("Fail to set custom value to ctsValue type : " << ctsStrCustomType); - contacts_svc_value_free(ctsValue); - continue; - } - } +// if(ctsStrCustomType != NULL) +// { +// errorCode = contacts_svc_value_set_str(ctsValue, CTS_NUM_VAL_LABEL_STR, ctsStrCustomType); +// if(errorCode != CTS_SUCCESS) +// { +// LogWarning("Fail to set custom value to ctsValue type : " << ctsStrCustomType); +// contacts_svc_value_free(ctsValue); +// continue; +// } +// } gsList = g_slist_append(gsList, ctsValue); } @@ -1058,16 +1139,16 @@ void ContactObjectA2PConverter::importEmailList() continue; } - if(ctsStrCustomType != NULL) - { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_EMAIL_VAL_LABEL_STR, ctsStrCustomType); - if(errorCode != CTS_SUCCESS) - { - LogWarning("Fail to set custom value to ctsValue type : " << ctsStrCustomType); - contacts_svc_value_free(ctsValue); - continue; - } - } +// if(ctsStrCustomType != NULL) +// { +// errorCode = contacts_svc_value_set_str(ctsValue, CTS_EMAIL_VAL_LABEL_STR, ctsStrCustomType); +// if(errorCode != CTS_SUCCESS) +// { +// LogWarning("Fail to set custom value to ctsValue type : " << ctsStrCustomType); +// contacts_svc_value_free(ctsValue); +// continue; +// } +// } gsList = g_slist_append(gsList, ctsValue); } @@ -1347,18 +1428,18 @@ GSList * ContactObjectA2PConverter::importEventListAnniversary(GSList *gsList) continue; } - if(anniversary->getLabelIsSet()) - { - string label = anniversary->getLabel(); - errorCode = contacts_svc_value_set_str(ctsValue, CTS_EVENT_VAL_LABEL_STR, label.c_str()); - if(errorCode != CTS_SUCCESS) - { - LogWarning("Fail to set label value to ctsValue type : " << label); - contacts_svc_value_free(ctsValue); - continue; - } - - } +// if(anniversary->getLabelIsSet()) +// { +// string label = anniversary->getLabel(); +// errorCode = contacts_svc_value_set_str(ctsValue, CTS_EVENT_VAL_LABEL_STR, label.c_str()); +// if(errorCode != CTS_SUCCESS) +// { +// LogWarning("Fail to set label value to ctsValue type : " << label); +// contacts_svc_value_free(ctsValue); +// continue; +// } +// +// } gsList = g_slist_append(gsList, ctsValue); } @@ -1530,16 +1611,16 @@ void ContactObjectA2PConverter::importPostalList() continue; } - if(ctsStrCustomType != NULL) - { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_POSTAL_VAL_LABEL_STR, ctsStrCustomType); - if(errorCode != CTS_SUCCESS) - { - LogWarning("Fail to set custom value to ctsValue type : " << ctsStrCustomType); - contacts_svc_value_free(ctsValue); - continue; - } - } +// if(ctsStrCustomType != NULL) +// { +// errorCode = contacts_svc_value_set_str(ctsValue, CTS_POSTAL_VAL_LABEL_STR, ctsStrCustomType); +// if(errorCode != CTS_SUCCESS) +// { +// LogWarning("Fail to set custom value to ctsValue type : " << ctsStrCustomType); +// contacts_svc_value_free(ctsValue); +// continue; +// } +// } gsList = g_slist_append(gsList, ctsValue); } @@ -1631,16 +1712,16 @@ void ContactObjectA2PConverter::importWebAddrList() continue; } - if(ctsStrCustomType != NULL) - { - errorCode = contacts_svc_value_set_str(ctsValue, CTS_WEB_VAL_LABEL_STR, ctsStrCustomType); - if(errorCode != CTS_SUCCESS) - { - LogWarning("Fail to set custom value to ctsValue type : " << ctsStrCustomType); - contacts_svc_value_free(ctsValue); - continue; - } - } +// if(ctsStrCustomType != NULL) +// { +// errorCode = contacts_svc_value_set_str(ctsValue, CTS_WEB_VAL_LABEL_STR, ctsStrCustomType); +// if(errorCode != CTS_SUCCESS) +// { +// LogWarning("Fail to set custom value to ctsValue type : " << ctsStrCustomType); +// contacts_svc_value_free(ctsValue); +// continue; +// } +// } gsList = g_slist_append(gsList, ctsValue); } diff --git a/src/platform/Tizen/Contact/ContactObjectA2PConverter.h b/src/platform/Tizen/Contact/ContactObjectA2PConverter.h index 12eeecd..f4ac741 100644 --- a/src/platform/Tizen/Contact/ContactObjectA2PConverter.h +++ b/src/platform/Tizen/Contact/ContactObjectA2PConverter.h @@ -63,9 +63,9 @@ protected: void importCompanyValueToNewValue(CTSvalue *ctsValue, TizenApis::Api::Contact::ContactOrganizationPtr &contactOrganization); - void importNoteValue(); - void importNoteValueToExistingValue(CTSvalue *ctsValue); - void importNoteValueToNewValue(CTSvalue *ctsValue); +// void importNoteValue(); +// void importNoteValueToExistingValue(CTSvalue *ctsValue); +// void importNoteValueToNewValue(CTSvalue *ctsValue); void importNumberList(); 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() { diff --git a/src/platform/Tizen/Contact/ContactObjectP2AConverter.h b/src/platform/Tizen/Contact/ContactObjectP2AConverter.h index baecd0c..595c754 100644 --- a/src/platform/Tizen/Contact/ContactObjectP2AConverter.h +++ b/src/platform/Tizen/Contact/ContactObjectP2AConverter.h @@ -50,7 +50,7 @@ protected: void exportBaseInfoValue(); void exportNameValue(); void exportCompanyValue(); - void exportNoteValue(); +// void exportNoteValue(); void exportNumberList(); void exportEmailList(); void exportGrouprelList(); diff --git a/src/platform/Tizen/Contact/query-svc/query-service.h b/src/platform/Tizen/Contact/query-svc/query-service.h index 7b862ac..0937b92 100755 --- a/src/platform/Tizen/Contact/query-svc/query-service.h +++ b/src/platform/Tizen/Contact/query-svc/query-service.h @@ -38,10 +38,10 @@ typedef enum CONTACT_IS_FAVORITE, CONTACT_RINGTONE, + CONTACT_NOTE, CONTACT_PHOTO_URI, CONTACT_LAST_UPDATED_TIME_STAMP, CONTACT_UID, - CONTACT_NOTE, NAME_FIRST = 40, NAME_MIDDLE, @@ -232,12 +232,6 @@ API void refresh_addressbook_list(void *data); API int* get_all_addressbook_id(int* total_count); -API int set_pref_to_condition(ADVANCED_HANDLE handle); - -API int check_pref_number(int contact_id, char* number); - -API int check_pref_email(int contact_id, char* email); - #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/src/platform/Tizen/Contact/query-svc/query-svc.c b/src/platform/Tizen/Contact/query-svc/query-svc.c index c60e2bb..c914e91 100755 --- a/src/platform/Tizen/Contact/query-svc/query-svc.c +++ b/src/platform/Tizen/Contact/query-svc/query-svc.c @@ -649,7 +649,7 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type break; case DB_DATATYPE_NUMBER: { - if(strcmp(field_key[FIELD_DATA3], projection) == 0 && q_handle->attribute_list[NUMBER_ADDRESS] == 1) + if(strcmp(field_key[FIELD_DATA2], projection) == 0 && q_handle->attribute_list[NUMBER_ADDRESS] == 1) { count = _value_to_projection(q_handle->hstmt, &(num_info->number), count); }else if(strcmp(field_key[FIELD_DATA1], projection) == 0 && q_handle->attribute_list[NUMBER_TYPES] == 1) @@ -660,7 +660,7 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type break; case DB_DATATYPE_EMAIL: { - if(strcmp(field_key[FIELD_DATA3], projection) == 0 && q_handle->attribute_list[EMAIL_ADDRESS] == 1) + if(strcmp(field_key[FIELD_DATA2], projection) == 0 && q_handle->attribute_list[EMAIL_ADDRESS] == 1) { count = _value_to_projection(q_handle->hstmt, &(email_info->email_addr), count); }else if(strcmp(field_key[FIELD_DATA1], projection) == 0 && q_handle->attribute_list[EMAIL_TYPE] == 1) @@ -672,7 +672,7 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type break; case DB_DATATYPE_URL: { - if(strcmp(field_key[FIELD_DATA3], projection) == 0 && q_handle->attribute_list[URL_ADDRESS] == 1) + if(strcmp(field_key[FIELD_DATA2], projection) == 0 && q_handle->attribute_list[URL_ADDRESS] == 1) { count = _value_to_projection(q_handle->hstmt, &(url_info->url_addr), count); }else if(strcmp(field_key[FIELD_DATA1], projection) == 0 && q_handle->attribute_list[URL_TYPE] == 1) @@ -683,7 +683,7 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type break; case DB_DATATYPE_NICK_NAME: { - if(strcmp(field_key[FIELD_DATA3], projection) == 0 && q_handle->attribute_list[NICKNAME_NAME] == 1) + if(strcmp(field_key[FIELD_DATA2], projection) == 0 && q_handle->attribute_list[NICKNAME_NAME] == 1) { count = _value_to_projection(q_handle->hstmt, &(nick_info->nick_name), count); } @@ -691,22 +691,22 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type break; case DB_DATATYPE_ADDRESS: { - if(strcmp(field_key[FIELD_DATA9], projection) == 0 && q_handle->attribute_list[ADDRESS_COUNTRY] == 1) + if(strcmp(field_key[FIELD_DATA8], projection) == 0 && q_handle->attribute_list[ADDRESS_COUNTRY] == 1) { count = _value_to_projection(q_handle->hstmt, &(address_info->country), count); - }else if(strcmp(field_key[FIELD_DATA5], projection) == 0 && q_handle->attribute_list[ADDRESS_REGION] == 1) + }else if(strcmp(field_key[FIELD_DATA4], projection) == 0 && q_handle->attribute_list[ADDRESS_REGION] == 1) { count = _value_to_projection(q_handle->hstmt, &(address_info->region), count); - }else if(strcmp(field_key[FIELD_DATA6], projection) == 0 && q_handle->attribute_list[ADDRESS_CITY] == 1) + }else if(strcmp(field_key[FIELD_DATA5], projection) == 0 && q_handle->attribute_list[ADDRESS_CITY] == 1) { count = _value_to_projection(q_handle->hstmt, &(address_info->city), count); - }else if(strcmp(field_key[FIELD_DATA7], projection) == 0 && q_handle->attribute_list[ADDRESS_STREET] == 1) + }else if(strcmp(field_key[FIELD_DATA6], projection) == 0 && q_handle->attribute_list[ADDRESS_STREET] == 1) { count = _value_to_projection(q_handle->hstmt, &(address_info->street), count); - }else if(strcmp(field_key[FIELD_DATA4], projection) == 0 && q_handle->attribute_list[ADDRESS_POSTAL_CODE] == 1) + }else if(strcmp(field_key[FIELD_DATA3], projection) == 0 && q_handle->attribute_list[ADDRESS_POSTAL_CODE] == 1) { count = _value_to_projection(q_handle->hstmt, &(address_info->postal_code), count); - }else if(strcmp(field_key[FIELD_DATA8], projection) == 0 && q_handle->attribute_list[ADDRESS_ADDITIONAL] == 1) + }else if(strcmp(field_key[FIELD_DATA7], projection) == 0 && q_handle->attribute_list[ADDRESS_ADDITIONAL] == 1) { count = _value_to_projection(q_handle->hstmt, &(address_info->addtional), count); }else if(strcmp(field_key[FIELD_DATA1], projection) == 0 && q_handle->attribute_list[ADDRESS_TYPE] == 1) @@ -717,16 +717,16 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type break; case DB_DATATYPE_ORGANIZATION: { - if(strcmp(field_key[FIELD_DATA3], projection) == 0 && q_handle->attribute_list[ORGANIZATION_NAME] == 1) + if(strcmp(field_key[FIELD_DATA2], projection) == 0 && q_handle->attribute_list[ORGANIZATION_NAME] == 1) { count = _value_to_projection(q_handle->hstmt, &(organization_info->organization_name), count); - }else if(strcmp(field_key[FIELD_DATA4], projection) == 0 && q_handle->attribute_list[ORGANIZATION_DEPARTMENT] == 1) + }else if(strcmp(field_key[FIELD_DATA3], projection) == 0 && q_handle->attribute_list[ORGANIZATION_DEPARTMENT] == 1) { count = _value_to_projection(q_handle->hstmt, &(organization_info->department), count); - }else if(strcmp(field_key[FIELD_DATA5], projection) == 0 && q_handle->attribute_list[ORGANIZATION_TITLE] == 1) + }else if(strcmp(field_key[FIELD_DATA4], projection) == 0 && q_handle->attribute_list[ORGANIZATION_TITLE] == 1) { count = _value_to_projection(q_handle->hstmt, &(organization_info->title), count); - }else if(strcmp(field_key[FIELD_DATA6], projection) == 0 && q_handle->attribute_list[ORGANIZATION_ROLE] == 1) + }else if(strcmp(field_key[FIELD_DATA5], projection) == 0 && q_handle->attribute_list[ORGANIZATION_ROLE] == 1) { count = _value_to_projection(q_handle->hstmt, &(organization_info->role), count); } @@ -737,20 +737,12 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type if(strcmp(field_key[FIELD_DATA1], projection) == 0 && q_handle->attribute_list[EVENT_TYPE] == 1) { count = _int_value_to_projection(DATA_TABLE, DB_DATATYPE_EVENT, q_handle->hstmt, &(event_info->type), count); - }else if(strcmp(field_key[FIELD_DATA3], projection) == 0 && q_handle->attribute_list[EVENT_DATE] == 1) + }else if(strcmp(field_key[FIELD_DATA2], projection) == 0 && q_handle->attribute_list[EVENT_DATE] == 1) { count = _event_value_to_projection(q_handle->hstmt, &(event_info->date), count); } } break; - case DB_DATATYPE_NOTE: - { - if(strcmp(field_key[FIELD_DATA3], projection) == 0 && q_handle->attribute_list[CONTACT_NOTE] == 1) - { - count = _value_to_projection(q_handle->hstmt, &(q_handle->result_set[q_handle->pos].contact_info->raw_contact_info->note), count); - } - } - break; default: { if(datatype_id > DB_DATATYPE_MAX) @@ -830,6 +822,9 @@ query_error _make_contact_info(advanced_handle_t* q_handle, projection_type type if(strcmp(field_key[FIELD_RINGTONE], projection) == 0) { count = _value_to_projection(q_handle->hstmt, &(q_handle->result_set[q_handle->pos].contact_info->raw_contact_info->ringtone), count); + }else if(strcmp(field_key[FIELD_NOTE], projection) == 0) + { + count = _value_to_projection(q_handle->hstmt, &(q_handle->result_set[q_handle->pos].contact_info->raw_contact_info->note), count); }else if(strcmp(field_key[FIELD_IS_FAVORITE], projection) == 0) { count = _int_value_to_projection(CONTACT_TABLE, DB_DATATYPE_INVALID, q_handle->hstmt, @@ -1269,36 +1264,6 @@ query_error _make_contact_id_list_by_condition_part(advanced_handle_t* q_handle, g_string_append_printf (sub_query, " where"); - if(q_handle->set_number_pref == 1) - { - GList* tmp_table1 = q_handle->condition_table_list; - while(tmp_table1) - { - condition_table_t* table_info1 = (condition_table_t*)tmp_table1->data; - if(strcmp(table_info1->table, "data") == 0) - { - g_string_append_printf (sub_query, " (%s.is_default = 1 and %s.datatype = 8) and", alias_key[table_info1->alias], alias_key[table_info1->alias]); - break; - } - tmp_table1 = g_list_next(tmp_table1); - } - } - - if(q_handle->set_email_pref == 1) - { - GList* tmp_table2 = q_handle->condition_table_list; - while(tmp_table2) - { - condition_table_t* table_info2 = (condition_table_t*)tmp_table2->data; - if(strcmp(table_info2->table, "data") == 0) - { - g_string_append_printf (sub_query, " (%s.is_default = 1 and %s.datatype = 9) and", alias_key[table_info2->alias], alias_key[table_info2->alias]); - break; - } - tmp_table2 = g_list_next(tmp_table2); - } - } - if(tmp_query->str[0] != '\0') g_string_append_printf (sub_query, " %s", tmp_query->str); @@ -1625,8 +1590,7 @@ int _make_result_contact_list(advanced_handle_t* q_handle, int count, char* cond condition_val_t* tmp_val = (condition_val_t*)tmp_condition_val->data; if(tmp_val->indices_filter == 0) { - ADVANCED_SVC_TRACE("condition_val->value_str : %s", tmp_val->value); - ADVANCED_SVC_TRACE("condition_val->value_int : %d", tmp_val->int_value); + ADVANCED_SVC_TRACE("condition_val->value : %s", tmp_val->value); primitive_type type = _convert_check_attribute_primitive_type(tmp_val->attribute); if(tmp_val->x_attribute == 1) @@ -3633,87 +3597,3 @@ API int get_contact_version() return ver; } -API int set_number_pref_to_condition(ADVANCED_HANDLE handle) -{ - ADVANCED_RETURN_VAL((handle != NULL), {}, QUERY_HANDLE_NONE, ("HANDLE IS NULL")); - advanced_handle_t* q_handle = (advanced_handle_t*)handle; - - q_handle->set_number_pref = 1; - - return QUERY_SUCCESS; -} - -API int set_email_pref_to_condition(ADVANCED_HANDLE handle) -{ - ADVANCED_RETURN_VAL((handle != NULL), {}, QUERY_HANDLE_NONE, ("HANDLE IS NULL")); - advanced_handle_t* q_handle = (advanced_handle_t*)handle; - - q_handle->set_email_pref = 1; - - return QUERY_SUCCESS; -} - -API int check_pref_number(int contact_id, char* number) -{ - char query[256 + 1] = {0, }; - int rc = -1; - stmt pStmt = NULL; - int pref = 0; - query_error error_code = QUERY_SUCCESS; - - error_code = _contact_db_init(); - ADVANCED_CATCH_SET_ERROR((error_code == QUERY_SUCCESS), {}, QUERY_STATEMENT_FAIL, ("DATABASE INIT FAIL")); - - snprintf(query, 256, "%s", "select is_default from data where contact_id = ? and data3 = ? and datatype = 8"); - - pStmt = _contact_query_prepare(query); - ADVANCED_CATCH_SET_ERROR((pStmt != NULL), {}, QUERY_STATEMENT_FAIL, ("database prepare fail")); - - _contact_query_bind_int(pStmt, 1, contact_id); - _contact_query_bind_text(pStmt, 2, number); - - rc = _contact_query_step(pStmt); - ADVANCED_CATCH_SET_ERROR((rc == SQLITE_ROW), {}, QUERY_NO_RECORD, ("No record in database")); - - pref = _ct_query_column_int(pStmt, 0); - ADVANCED_SVC_TRACE("pref: %d ", pref); - -CATCH: - _ct_query_finalize(pStmt); - _contact_db_finish(); - - return pref; -} - -API int check_pref_email(int contact_id, char* email) -{ - char query[256 + 1] = {0, }; - int rc = -1; - stmt pStmt = NULL; - int pref = 0; - query_error error_code = QUERY_SUCCESS; - - error_code = _contact_db_init(); - ADVANCED_CATCH_SET_ERROR((error_code == QUERY_SUCCESS), {}, QUERY_STATEMENT_FAIL, ("DATABASE INIT FAIL")); - - snprintf(query, 256, "%s", "select is_default from data where contact_id = ? and data3 = ? and datatype = 9"); - - pStmt = _contact_query_prepare(query); - ADVANCED_CATCH_SET_ERROR((pStmt != NULL), {}, QUERY_STATEMENT_FAIL, ("database prepare fail")); - - _contact_query_bind_int(pStmt, 1, contact_id); - _contact_query_bind_text(pStmt, 2, email); - - rc = _contact_query_step(pStmt); - ADVANCED_CATCH_SET_ERROR((rc == SQLITE_ROW), {}, QUERY_NO_RECORD, ("No record in database")); - - pref = _ct_query_column_int(pStmt, 0); - ADVANCED_SVC_TRACE("pref: %d ", pref); - -CATCH: - _ct_query_finalize(pStmt); - _contact_db_finish(); - - return pref; -} - diff --git a/src/platform/Tizen/Contact/query-svc/query-type.h b/src/platform/Tizen/Contact/query-svc/query-type.h index 4e7009d..ca8c6db 100755 --- a/src/platform/Tizen/Contact/query-svc/query-type.h +++ b/src/platform/Tizen/Contact/query-svc/query-type.h @@ -160,7 +160,7 @@ typedef enum DATATYPE_BIRTH_DAY = 0x00000080, DATATYPE_ANNIVERSARY = 0x0000100, DATATYPE_IM_ADDR = 0x0000200, - DATATYPE_NOTE = 0x00000400, +// DATATYPE_LBS_INFO = 0x00000400, DATATYPE_CATEGORY = 0x00000800, DATATYPE_X_ATTRIBUTE = 0x80000000, }predefine_datatype; @@ -176,8 +176,7 @@ typedef enum DB_DATATYPE_ORGANIZATION, DB_DATATYPE_NICK_NAME, DB_DATATYPE_NUMBER, - DB_DATATYPE_EMAIL = 9, - DB_DATATYPE_NOTE = 12, + DB_DATATYPE_EMAIL, // DB_DATATYPE_LBS_INFO, // DB_DATATYPE_CATEGORY, @@ -223,8 +222,8 @@ static char* number_type_str[MAX_NUMBER_TYPE] = typedef enum { EMAIL_TYPE_NONE = 0x00000000, - EMAIL_HOME = 0x00000002, - EMAIL_WORK = 0x00000004, + EMAIL_HOME = 0x00000001, + EMAIL_WORK = 0x00000002, }email_type; static char* email_type_str[MAX_EMAIL_TYPE] = @@ -251,7 +250,7 @@ static char* url_type_str[URL_TYPE_MAX] = typedef enum { - EVENT_BIRTHDAY = 2, + EVENT_BIRTHDAY = 0, EVENT_ANNIVERSARY, EVENT_TYPE_MAX }event_type; @@ -551,8 +550,6 @@ typedef struct { query_type_e query_type; stmt hstmt; - int set_number_pref; - int set_email_pref; // result set int pos; //array index of ordering list diff --git a/src/platform/Tizen/Contact/query-svc/query-utility.c b/src/platform/Tizen/Contact/query-svc/query-utility.c index 38ae0fb..c22db1c 100755 --- a/src/platform/Tizen/Contact/query-svc/query-utility.c +++ b/src/platform/Tizen/Contact/query-svc/query-utility.c @@ -31,7 +31,7 @@ #include static int transaction_count = 0; -static int db_connnect_count = 1; +static int db_connnect_count = 0; clock_t _get_clock() @@ -229,7 +229,7 @@ stmt _contact_query_prepare(char *query) stmt pStmt = NULL; ADVANCED_SVC_TRACE("query : %s !!!!\n", query); - printf("\nquery : %s !!!!\n", query); +// printf("\nquery : %s !!!!\n", query); rc = sqlite3_prepare_v2(g_hDBCt, query, strlen(query), &pStmt, NULL); if(SQLITE_OK != rc) @@ -324,11 +324,9 @@ predefine_datatype _convert_attribute_to_mimetype_id(contact_attribute_e attribu // case ORGANIZATION_LOGO_URI: data_type = DATATYPE_ORGANIZATION; break; - case CONTACT_NOTE: - data_type = DATATYPE_NOTE; - break; case CONTACT_IS_FAVORITE: case CONTACT_RINGTONE: + case CONTACT_NOTE: // case CONTACT_READ_ONLY: // case CONTACT_SEND_TO_VOICE_MAIL: case CONTACT_LAST_UPDATED_TIME_STAMP: @@ -474,7 +472,7 @@ char* _convert_attribute_to_condition_column_name(contact_attribute_e attribute) field_name = condition_field_key[FIELD_RINGTONE]; break; case CONTACT_NOTE : - field_name = condition_field_key[FIELD_DATA3]; + field_name = condition_field_key[FIELD_NOTE]; break; case CONTACT_ID : field_name = condition_field_key[FIELD_DATA_CONTACT_ID]; @@ -525,46 +523,46 @@ char* _convert_attribute_to_condition_column_name(contact_attribute_e attribute) field_name = condition_field_key[FIELD_DATA7]; break; case NICKNAME_NAME: - field_name = condition_field_key[FIELD_DATA3]; + field_name = condition_field_key[FIELD_DATA2]; break; case NUMBER_ADDRESS: - field_name = condition_field_key[FIELD_DATA3]; + field_name = condition_field_key[FIELD_DATA2]; break; case NUMBER_TYPES: field_name = condition_field_key[FIELD_DATA1]; break; case EMAIL_ADDRESS: - field_name = condition_field_key[FIELD_DATA3]; + field_name = condition_field_key[FIELD_DATA2]; break; case EMAIL_TYPE: field_name = condition_field_key[FIELD_DATA1]; break; case URL_ADDRESS: - field_name = condition_field_key[FIELD_DATA3]; + field_name = condition_field_key[FIELD_DATA2]; break; case URL_TYPE: field_name = condition_field_key[FIELD_DATA1]; break; case ADDRESS_COUNTRY: - field_name = condition_field_key[FIELD_DATA9]; + field_name = condition_field_key[FIELD_DATA8]; break; case ADDRESS_REGION: - field_name = condition_field_key[FIELD_DATA5]; + field_name = condition_field_key[FIELD_DATA4]; break; // case ADDRESS_COUNTY: // field_name = condition_field_key[FIELD_DATA5]; // break; case ADDRESS_CITY: - field_name = condition_field_key[FIELD_DATA6]; + field_name = condition_field_key[FIELD_DATA5]; break; case ADDRESS_STREET: - field_name = condition_field_key[FIELD_DATA7]; + field_name = condition_field_key[FIELD_DATA6]; break; case ADDRESS_POSTAL_CODE: - field_name = condition_field_key[FIELD_DATA4]; + field_name = condition_field_key[FIELD_DATA3]; break; case ADDRESS_ADDITIONAL: - field_name = condition_field_key[FIELD_DATA8]; + field_name = condition_field_key[FIELD_DATA7]; break; case ADDRESS_TYPE: field_name = condition_field_key[FIELD_DATA1]; @@ -576,25 +574,25 @@ char* _convert_attribute_to_condition_column_name(contact_attribute_e attribute) field_name = condition_field_key[FIELD_DATA1]; break; case EVENT_DATE: - field_name = condition_field_key[FIELD_DATA3]; + field_name = condition_field_key[FIELD_DATA2]; break; // case ANNIVERSARY_LABEL: // field_name = condition_field_key[FIELD_DATA2]; // break; case ORGANIZATION_NAME: - field_name = condition_field_key[FIELD_DATA3]; + field_name = condition_field_key[FIELD_DATA2]; break; case ORGANIZATION_DEPARTMENT: - field_name = condition_field_key[FIELD_DATA4]; + field_name = condition_field_key[FIELD_DATA3]; break; // case ORGANIZATION_OFFICE: // field_name = condition_field_key[FIELD_DATA3]; // break; case ORGANIZATION_TITLE: - field_name = condition_field_key[FIELD_DATA5]; + field_name = condition_field_key[FIELD_DATA4]; break; case ORGANIZATION_ROLE: - field_name = condition_field_key[FIELD_DATA6]; + field_name = condition_field_key[FIELD_DATA5]; break; // case ORGANIZATION_LOGO_URI: // field_name = condition_field_key[FIELD_DATA6]; @@ -724,7 +722,7 @@ char* _convert_attribute_to_column_name(contact_attribute_e attribute) field_name = field_key[FIELD_RINGTONE]; break; case CONTACT_NOTE : - field_name = field_key[FIELD_DATA3]; + field_name = field_key[FIELD_NOTE]; break; case CONTACT_UID : field_name = field_key[FIELD_UID]; @@ -777,46 +775,46 @@ char* _convert_attribute_to_column_name(contact_attribute_e attribute) field_name = field_key[FIELD_DATA7]; break; case NICKNAME_NAME: - field_name = field_key[FIELD_DATA3]; + field_name = field_key[FIELD_DATA2]; break; case NUMBER_ADDRESS: - field_name = field_key[FIELD_DATA3]; + field_name = field_key[FIELD_DATA2]; break; case NUMBER_TYPES: field_name = field_key[FIELD_DATA1]; break; case EMAIL_ADDRESS: - field_name = field_key[FIELD_DATA3]; + field_name = field_key[FIELD_DATA1]; break; case EMAIL_TYPE: field_name = field_key[FIELD_DATA2]; break; case URL_ADDRESS: - field_name = field_key[FIELD_DATA3]; + field_name = field_key[FIELD_DATA1]; break; case URL_TYPE: - field_name = field_key[FIELD_DATA1]; + field_name = field_key[FIELD_DATA2]; break; case ADDRESS_COUNTRY: - field_name = field_key[FIELD_DATA9]; + field_name = field_key[FIELD_DATA8]; break; case ADDRESS_REGION: - field_name = field_key[FIELD_DATA5]; + field_name = field_key[FIELD_DATA4]; break; // case ADDRESS_COUNTY: // field_name = field_key[FIELD_DATA5]; // break; case ADDRESS_CITY: - field_name = field_key[FIELD_DATA6]; + field_name = field_key[FIELD_DATA5]; break; case ADDRESS_STREET: - field_name = field_key[FIELD_DATA7]; + field_name = field_key[FIELD_DATA6]; break; case ADDRESS_POSTAL_CODE: - field_name = field_key[FIELD_DATA4]; + field_name = field_key[FIELD_DATA3]; break; case ADDRESS_ADDITIONAL: - field_name = field_key[FIELD_DATA8]; + field_name = field_key[FIELD_DATA7]; break; case ADDRESS_TYPE: field_name = field_key[FIELD_DATA1]; @@ -828,25 +826,25 @@ char* _convert_attribute_to_column_name(contact_attribute_e attribute) field_name = field_key[FIELD_DATA1]; break; case EVENT_DATE: - field_name = field_key[FIELD_DATA3]; + field_name = field_key[FIELD_DATA2]; break; // case ANNIVERSARY_LABEL: // field_name = field_key[FIELD_DATA2]; // break; case ORGANIZATION_NAME: - field_name = field_key[FIELD_DATA3]; + field_name = field_key[FIELD_DATA2]; break; case ORGANIZATION_DEPARTMENT: - field_name = field_key[FIELD_DATA4]; + field_name = field_key[FIELD_DATA3]; break; // case ORGANIZATION_OFFICE: // field_name = field_key[FIELD_DATA3]; // break; case ORGANIZATION_TITLE: - field_name = field_key[FIELD_DATA5]; + field_name = field_key[FIELD_DATA4]; break; case ORGANIZATION_ROLE: - field_name = field_key[FIELD_DATA6]; + field_name = field_key[FIELD_DATA5]; break; // case ORGANIZATION_LOGO_URI: // field_name = field_key[FIELD_DATA6]; @@ -959,6 +957,7 @@ char* _convert_attribute_to_table_name(contact_attribute_e attribute) case CONTACT_LAST_UPDATED_TIME_STAMP: case CONTACT_IS_FAVORITE: case CONTACT_RINGTONE : + case CONTACT_NOTE : case ACCOUNT_ID: case CONTACT_UID: { @@ -999,7 +998,6 @@ char* _convert_attribute_to_table_name(contact_attribute_e attribute) case ORGANIZATION_TITLE: case ORGANIZATION_ROLE: // case ORGANIZATION_LOGO_URI: - case CONTACT_NOTE : { table_name = table_key[TABLE_DATA]; } @@ -1439,10 +1437,10 @@ db_datatype _convert_datatype_to_db_type(predefine_datatype datatype) case DATATYPE_ANNIVERSARY: db_datatype_id = DB_DATATYPE_EVENT; break; - case DATATYPE_NOTE: - db_datatype_id = DB_DATATYPE_NOTE; - break; /* + case DATATYPE_LBS_INFO: + db_datatype_id = DB_DATATYPE_LBS_INFO; + break; case DATATYPE_CATEGORY: db_datatype_id = DB_DATATYPE_CATEGORY; break; @@ -1853,10 +1851,10 @@ int _convert_type_string_to_int(contact_attribute_e attribute, const char* value integer_value = (int)strtol(value, &end_ptr, 0); if(errno == ERANGE || end_ptr == value) { -// ADVANCED_SVC_TRACE("contact_id is wrong : %s", contact_id); + ADVANCED_SVC_TRACE("contact_id is wrong : %s", contact_id); return 0; } - ADVANCED_SVC_TRACE("id : %d", integer_value); + ADVANCED_SVC_TRACE("id : %d", id); } break; case CONTACT_LAST_UPDATED_TIME_STAMP : @@ -1866,7 +1864,7 @@ int _convert_type_string_to_int(contact_attribute_e attribute, const char* value integer_value = (int)strtol(value, &end_ptr, 0); if(errno == ERANGE || end_ptr == value) { -// ADVANCED_SVC_TRACE("contact_id is wrong : %s", contact_id); + ADVANCED_SVC_TRACE("contact_id is wrong : %s", contact_id); return 0; } } diff --git a/src/platform/Tizen/Contact/query-svc/query-utility.h b/src/platform/Tizen/Contact/query-svc/query-utility.h index a25935e..fb8432b 100755 --- a/src/platform/Tizen/Contact/query-svc/query-utility.h +++ b/src/platform/Tizen/Contact/query-svc/query-utility.h @@ -80,6 +80,7 @@ typedef enum FIELD_IS_FAVORITE, FIELD_PHOTO_URI, FIELD_RINGTONE, + FIELD_NOTE, FIELD_UID, FIELD_DATA_PERSON_ID, @@ -127,8 +128,9 @@ static char* field_key[FIELD_MAX] = "contacts.addrbook_id", "contacts.changed_time", "contacts.is_favorite", - "contacts.image_thumbnail_path", - "contacts.ringtone_path", + "contacts.image0", + "contacts.ringtone", + "contacts.note", "contacts.uid", "data.person_id", "data.contact_id", @@ -174,8 +176,9 @@ static char* condition_field_key[FIELD_MAX] = "addrbook_id", "changed_time", "is_favorite", - "image_thumbnail_path", - "ringtone_path", + "image0", + "ringtone", + "note", "uid", "person_id", "contact_id", @@ -211,7 +214,7 @@ static char* group_field_key[FIELD_GROUP_MAX] = { "group_id", //0 "group_name", - "ringtone_path" + "ringtone" }; typedef enum diff --git a/src/platform/Tizen/Mediacontent/MediaSearchVisitor.cpp b/src/platform/Tizen/Mediacontent/MediaSearchVisitor.cpp index 3bbc1e7..ecf6646 100755 --- a/src/platform/Tizen/Mediacontent/MediaSearchVisitor.cpp +++ b/src/platform/Tizen/Mediacontent/MediaSearchVisitor.cpp @@ -263,7 +263,7 @@ string MediaSearchVisitor::convertAttribute(string &attrName, AnyPtr& matchValue } else { - conditionStr = STR_LEFT_BRACKET + attrName + operatorStr + valueStr + STR_RIGHT_BRACKET; + conditionStr = STR_LEFT_BRACKET + attrName + operatorStr + valueStr + STR_RIGHT_BRACKET; } return conditionStr; diff --git a/src/platform/Tizen/Mediacontent/Mediacontent.cpp b/src/platform/Tizen/Mediacontent/Mediacontent.cpp index 45ebe57..0e145fe 100755 --- a/src/platform/Tizen/Mediacontent/Mediacontent.cpp +++ b/src/platform/Tizen/Mediacontent/Mediacontent.cpp @@ -868,8 +868,8 @@ void Mediacontent::OnRequestReceived(const IEventBrowseFolderPtr &eBrowse) { LogDebug("limit or offset"); - int count = -1; - int offset = 0; + long count = -1; + long offset = 0; if ( eBrowse->getLimitIsSet() ) { diff --git a/src/standards/Tizen/Mediacontent/JSMedia.cpp b/src/standards/Tizen/Mediacontent/JSMedia.cpp index 6d0131c..180fb4b 100755 --- a/src/standards/Tizen/Mediacontent/JSMedia.cpp +++ b/src/standards/Tizen/Mediacontent/JSMedia.cpp @@ -456,6 +456,7 @@ bool JSMedia::setPropertyRating( rating = 0; LogDebug("Rating value set 0 as inserted value is too small"); } + if ( objMedia->getRating() != rating) { diff --git a/src/standards/Tizen/Mediacontent/JSMediacontent.cpp b/src/standards/Tizen/Mediacontent/JSMediacontent.cpp index bad5baa..3141372 100755 --- a/src/standards/Tizen/Mediacontent/JSMediacontent.cpp +++ b/src/standards/Tizen/Mediacontent/JSMediacontent.cpp @@ -404,13 +404,13 @@ JSValueRef JSMediacontent::findItems( { long count = filterConverter->toLong(arguments[5]); - if(count > 0.0) + if(count > 0) { dplEvent->setLimit(count); } - else if ( count == 0.0) + else if ( count == 0) { - dplEvent->setLimit(-1); + dplEvent->setLimit(-1); // -1 is all row. } else { @@ -423,13 +423,13 @@ JSValueRef JSMediacontent::findItems( if(argumentCount >= 7) //optional unsigned long? offset { long offset = filterConverter->toLong(arguments[6]); - if(offset != 0.0) + if(offset != 0) { dplEvent->setOffset(offset); } else { - dplEvent->setOffset(-1); + dplEvent->setOffset(0); } } dplEvent->setPrivateData( DPL::StaticPointerCast (cbm)); -- 2.7.4