diff options
author | Gwangbok Kim <gwangbok.kim@samsung.com> | 2013-06-07 20:37:41 +0900 |
---|---|---|
committer | Gwangbok Kim <gwangbok.kim@samsung.com> | 2013-06-07 20:37:41 +0900 |
commit | 245e28cc300fddd343f07b1bd2f9c1f8cb8263d4 (patch) | |
tree | 817c1d45e7cf60744021c9fdf20f34885272da7b | |
parent | 6df3ef163888f7a3656e0a02db5e47a53c90c9c8 (diff) | |
download | social-245e28cc300fddd343f07b1bd2f9c1f8cb8263d4.tar.gz social-245e28cc300fddd343f07b1bd2f9c1f8cb8263d4.tar.bz2 social-245e28cc300fddd343f07b1bd2f9c1f8cb8263d4.zip |
DCM-1707
Change-Id: Iba2d6b05f62a8560e90495f0541bd1bf55992595
Signed-off-by: Gwangbok Kim <gwangbok.kim@samsung.com>
-rw-r--r-- | src/FScl_ContactImpl.cpp | 9 | ||||
-rw-r--r-- | src/FScl_PhoneNumberImpl.cpp | 12 | ||||
-rw-r--r-- | src/FScl_PhoneNumberImpl.h | 4 |
3 files changed, 22 insertions, 3 deletions
diff --git a/src/FScl_ContactImpl.cpp b/src/FScl_ContactImpl.cpp index 39b6464..fd6177d 100644 --- a/src/FScl_ContactImpl.cpp +++ b/src/FScl_ContactImpl.cpp @@ -2256,6 +2256,7 @@ _ContactImpl::SetPhoneNumberAt(int index, const PhoneNumber& phoneNumber) int type = 0; int oriType = 0; PhoneNumberType phoneNumberType = PHONENUMBER_TYPE_HOME; + bool isChanged = false; contacts_record_get_child_record_count(__contactHandle, _contacts_contact.number, &count); SysTryReturn(NID_SCL, count > (unsigned int) index, E_OUT_OF_RANGE, E_OUT_OF_RANGE, "[%s] index=%d must be less than the current count(%d) of phone numbers.", GetErrorMessage(E_OUT_OF_RANGE), index, count); @@ -2292,8 +2293,14 @@ _ContactImpl::SetPhoneNumberAt(int index, const PhoneNumber& phoneNumber) type = CONTACTS_NUMBER_TYPE_ASSISTANT; break; case PHONENUMBER_TYPE_OTHER: - contacts_record_get_int(recordHandle, _contacts_number.type, &oriType); + isChanged = _PhoneNumberImpl::GetInstance(phoneNumber)->IsPhoneNumberTypeChanged(); + if (isChanged) + { + type = CONTACTS_NUMBER_TYPE_OTHER; + break; + } + contacts_record_get_int(recordHandle, _contacts_number.type, &oriType); phoneNumberType = GetNativePhoneNumberType(oriType); if (phoneNumberType == PHONENUMBER_TYPE_OTHER) { diff --git a/src/FScl_PhoneNumberImpl.cpp b/src/FScl_PhoneNumberImpl.cpp index fade7ea..76c2ca0 100644 --- a/src/FScl_PhoneNumberImpl.cpp +++ b/src/FScl_PhoneNumberImpl.cpp @@ -34,6 +34,7 @@ namespace Tizen { namespace Social _PhoneNumberImpl::_PhoneNumberImpl(void) : __recordId(-1) , __type(PHONENUMBER_TYPE_HOME) +, __isPhoneTypeChanged(false) { } @@ -42,6 +43,7 @@ _PhoneNumberImpl::_PhoneNumberImpl(PhoneNumberType type, const String& number) : __recordId(-1) , __type(type) , __number(number) +, __isPhoneTypeChanged(false) { } @@ -52,11 +54,11 @@ _PhoneNumberImpl::_PhoneNumberImpl(const _PhoneNumberImpl& rhs) __type = rhs.__type; __label = rhs.__label; __number = rhs.__number; + __isPhoneTypeChanged = rhs.__isPhoneTypeChanged; } _PhoneNumberImpl::~_PhoneNumberImpl(void) { - } _PhoneNumberImpl& @@ -71,6 +73,7 @@ _PhoneNumberImpl::operator =(const _PhoneNumberImpl& rhs) __type = rhs.__type; __label = rhs.__label; __number = rhs.__number; + __isPhoneTypeChanged = rhs.__isPhoneTypeChanged; return *this; } @@ -132,6 +135,7 @@ void _PhoneNumberImpl::SetType(PhoneNumberType type) { __type = type; + __isPhoneTypeChanged = true; } result @@ -174,6 +178,12 @@ _PhoneNumberImpl::IsEmpty(void) const return __number.IsEmpty(); } +bool +_PhoneNumberImpl::IsPhoneNumberTypeChanged(void) const +{ + return __isPhoneTypeChanged; +} + _PhoneNumberImpl* _PhoneNumberImpl::GetInstance(PhoneNumber& phoneNumber) { diff --git a/src/FScl_PhoneNumberImpl.h b/src/FScl_PhoneNumberImpl.h index b99c3e4..edd822c 100644 --- a/src/FScl_PhoneNumberImpl.h +++ b/src/FScl_PhoneNumberImpl.h @@ -70,7 +70,6 @@ public: result SetPhoneNumber(const Tizen::Base::String& number); - // getter int GetRecordId(void) const; @@ -82,6 +81,8 @@ public: bool IsEmpty(void) const; + bool IsPhoneNumberTypeChanged(void) const; + static _PhoneNumberImpl* GetInstance(PhoneNumber& phoneNUmber); static const _PhoneNumberImpl* GetInstance(const PhoneNumber& phoneNUmber); @@ -98,6 +99,7 @@ private: PhoneNumberType __type; Tizen::Base::String __label; Tizen::Base::String __number; + bool __isPhoneTypeChanged; }; // _PhoneNumberImpl }} // Tizen::Social |