summaryrefslogtreecommitdiffabout
path: root/kabc
authorzautrix <zautrix>2005-01-18 10:15:21 (UTC)
committer zautrix <zautrix>2005-01-18 10:15:21 (UTC)
commitfbc1ca53388337b66017973896725d51416aae1a (patch) (side-by-side diff)
tree436dd042c407dd994976c8e460d4c85d527799b7 /kabc
parentf973a8310cc378cc86d96bfce3f08f06725a2b7d (diff)
downloadkdepimpi-fbc1ca53388337b66017973896725d51416aae1a.zip
kdepimpi-fbc1ca53388337b66017973896725d51416aae1a.tar.gz
kdepimpi-fbc1ca53388337b66017973896725d51416aae1a.tar.bz2
fix
Diffstat (limited to 'kabc') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index 82b4b9b..bfcfab5 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -315,48 +315,67 @@ void Addressee::mergeContact( const Addressee& ad , bool isSubSet) // = false)
if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString;
QStringList t;
QStringList tAD;
uint iii;
// ********** phone numbers
if ( isSubSet ) {
PhoneNumber::List phoneAD = ad.phoneNumbers();
PhoneNumber::List::Iterator phoneItAD;
for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) {
bool found = false;
PhoneNumber::List::Iterator it;
for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) {
if ( ( *phoneItAD ).contains( (*it) ) ) {
found = true;
(*it).setType( ( *phoneItAD ).type() );
(*it).setNumber( ( *phoneItAD ).number() );
break;
}
}
// if ( isSubSet && ! found )
if ( ! found ) // LR try this one...
mData->phoneNumbers.append( *phoneItAD );
}
+ } else {
+ PhoneNumber::List phoneAD = ad.phoneNumbers();
+ PhoneNumber::List::Iterator phoneItAD;
+ for ( phoneItAD = phoneAD.begin(); phoneItAD != phoneAD.end(); ++phoneItAD ) {
+ bool found = false;
+ PhoneNumber::List::Iterator it;
+ for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) {
+ if ( ( *phoneItAD ).contains( (*it) ) ) {
+ found = true;
+ (*it).setType( ( *phoneItAD ).type() );
+ (*it).setNumber( ( *phoneItAD ).number() );
+ break;
+ }
+ }
+ if ( ! found ) { // append numbers which do not have work or home type
+ if ( ! ( ( *phoneItAD ).type() & (PhoneNumber::Work | PhoneNumber::Home) ) )
+ mData->phoneNumbers.append( *phoneItAD );
+ }
+ }
}
if ( isSubSet ) {
// ************* emails;
t = mData->emails;
tAD = ad.mData->emails;
for ( iii = 0; iii < tAD.count(); ++iii)
if ( !t.contains(tAD[iii] ) )
mData->emails.append( tAD[iii] );
}
// ************* categories;
if ( isSubSet ) {
t = mData->categories;
tAD = ad.mData->categories;
for ( iii = 0; iii < tAD.count(); ++iii)
if ( !t.contains(tAD[iii] ) )
mData->categories.append( tAD[iii] );
}
QStringList::ConstIterator it;
for( it = ad.mData->custom.begin(); it != ad.mData->custom.end(); ++it ) {
QString qualifiedName = (*it).left( (*it).find( ":" ));
bool found = false;
QStringList::ConstIterator itL;
for( itL = mData->custom.begin(); itL != mData->custom.end(); ++itL ) {