-rw-r--r-- | kabc/addressee.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 3b238f5..82b4b9b 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp @@ -286,4 +286,7 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) { + // merge all standard non-outlook fields. + //if isSubSet (e.g. mobile phone sync) merge all fields detach(); + if ( isSubSet ) { if ( mData->name.isEmpty() ) mData->name = ad.mData->name; @@ -295,3 +298,9 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; + if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; + if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; + if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; + if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; + if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; + if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; if ( !mData->birthday.isValid() ) @@ -299,2 +308,4 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) mData->birthday = ad.mData->birthday; + + } if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; @@ -302,10 +313,4 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; - if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; - if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; - if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; - if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; - if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; - if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; QStringList t; @@ -315,2 +320,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) // ********** phone numbers + if ( isSubSet ) { PhoneNumber::List phoneAD = ad.phoneNumbers(); @@ -332,2 +338,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) } + } if ( isSubSet ) { @@ -342,2 +349,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) // ************* categories; + if ( isSubSet ) { t = mData->categories; @@ -347,2 +355,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) mData->categories.append( tAD[iii] ); + } QStringList::ConstIterator it; @@ -391,2 +400,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) } + if ( isSubSet ) { KABC::Address::List::Iterator addressIterA; @@ -408,2 +418,3 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false) } + } //qDebug("merge contact %s ", ad.uid().latin1()); |