-rw-r--r-- | kabc/addressee.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 0157721..3a2dc5f 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -133,33 +133,33 @@ bool Addressee::operator==( const Addressee &a ) const | |||
133 | if ( mData->formattedName != a.mData->formattedName ) return false; | 133 | if ( mData->formattedName != a.mData->formattedName ) return false; |
134 | if ( mData->familyName != a.mData->familyName ) return false; | 134 | if ( mData->familyName != a.mData->familyName ) return false; |
135 | if ( mData->givenName != a.mData->givenName ) return false; | 135 | if ( mData->givenName != a.mData->givenName ) return false; |
136 | if ( mData->additionalName != a.mData->additionalName ) return false; | 136 | if ( mData->additionalName != a.mData->additionalName ) return false; |
137 | if ( mData->prefix != a.mData->prefix ) return false; | 137 | if ( mData->prefix != a.mData->prefix ) return false; |
138 | if ( mData->suffix != a.mData->suffix ) return false; | 138 | if ( mData->suffix != a.mData->suffix ) return false; |
139 | if ( mData->nickName != a.mData->nickName ) return false; | 139 | if ( mData->nickName != a.mData->nickName ) return false; |
140 | if ( mData->birthday != a.mData->birthday ) return false; | 140 | if ( mData->birthday != a.mData->birthday ) return false; |
141 | if ( mData->mailer != a.mData->mailer ) return false; | 141 | if ( mData->mailer != a.mData->mailer ) return false; |
142 | if ( mData->timeZone != a.mData->timeZone ) return false; | 142 | if ( mData->timeZone != a.mData->timeZone ) return false; |
143 | if ( mData->geo != a.mData->geo ) return false; | 143 | if ( mData->geo != a.mData->geo ) return false; |
144 | if ( mData->title != a.mData->title ) return false; | 144 | if ( mData->title != a.mData->title ) return false; |
145 | if ( mData->role != a.mData->role ) return false; | 145 | if ( mData->role != a.mData->role ) return false; |
146 | if ( mData->organization != a.mData->organization ) return false; | 146 | if ( mData->organization != a.mData->organization ) return false; |
147 | if ( mData->note != a.mData->note ) return false; | 147 | if ( mData->note != a.mData->note ) return false; |
148 | if ( mData->productId != a.mData->productId ) return false; | 148 | if ( mData->productId != a.mData->productId ) return false; |
149 | if ( mData->revision != a.mData->revision ) return false; | 149 | //if ( mData->revision != a.mData->revision ) return false; |
150 | if ( mData->sortString != a.mData->sortString ) return false; | 150 | if ( mData->sortString != a.mData->sortString ) return false; |
151 | if ( mData->secrecy != a.mData->secrecy ) return false; | 151 | if ( mData->secrecy != a.mData->secrecy ) return false; |
152 | if ( mData->logo != a.mData->logo ) return false; | 152 | if ( mData->logo != a.mData->logo ) return false; |
153 | if ( mData->photo != a.mData->photo ) return false; | 153 | if ( mData->photo != a.mData->photo ) return false; |
154 | if ( mData->sound != a.mData->sound ) return false; | 154 | if ( mData->sound != a.mData->sound ) return false; |
155 | if ( mData->agent != a.mData->agent ) return false; | 155 | if ( mData->agent != a.mData->agent ) return false; |
156 | if ( ( mData->url.isValid() || a.mData->url.isValid() ) && | 156 | if ( ( mData->url.isValid() || a.mData->url.isValid() ) && |
157 | ( mData->url != a.mData->url ) ) return false; | 157 | ( mData->url != a.mData->url ) ) return false; |
158 | if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false; | 158 | if ( mData->phoneNumbers != a.mData->phoneNumbers ) return false; |
159 | if ( mData->addresses != a.mData->addresses ) return false; | 159 | if ( mData->addresses != a.mData->addresses ) return false; |
160 | if ( mData->keys != a.mData->keys ) return false; | 160 | if ( mData->keys != a.mData->keys ) return false; |
161 | if ( mData->emails != a.mData->emails ) return false; | 161 | if ( mData->emails != a.mData->emails ) return false; |
162 | if ( mData->categories != a.mData->categories ) return false; | 162 | if ( mData->categories != a.mData->categories ) return false; |
163 | if ( mData->custom != a.mData->custom ) return false; | 163 | if ( mData->custom != a.mData->custom ) return false; |
164 | 164 | ||
165 | return true; | 165 | return true; |
@@ -276,43 +276,50 @@ void Addressee::computeCsum(const QString &dev) | |||
276 | void Addressee::mergeContact( const Addressee& ad ) | 276 | void Addressee::mergeContact( const Addressee& ad ) |
277 | { | 277 | { |
278 | 278 | ||
279 | detach(); | 279 | detach(); |
280 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; | 280 | if ( mData->name.isEmpty() ) mData->name = ad.mData->name; |
281 | if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; | 281 | if ( mData->formattedName.isEmpty() ) mData->formattedName = ad.mData->formattedName; |
282 | if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; | 282 | if ( mData->familyName.isEmpty() ) mData->familyName = ad.mData->familyName; |
283 | if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; | 283 | if ( mData->givenName.isEmpty() ) mData->givenName = ad.mData->givenName ; |
284 | if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; | 284 | if ( mData->additionalName ) mData->additionalName = ad.mData->additionalName; |
285 | if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; | 285 | if ( mData->prefix.isEmpty() ) mData->prefix = ad.mData->prefix; |
286 | if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; | 286 | if ( mData->suffix.isEmpty() ) mData->suffix = ad.mData->suffix; |
287 | if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; | 287 | if ( mData->nickName.isEmpty() ) mData->nickName = ad.mData->nickName; |
288 | if ( !mData->birthday.isValid() ) | 288 | if ( !mData->birthday.isValid() ) |
289 | if ( ad.mData->birthday.isValid()) | 289 | if ( ad.mData->birthday.isValid()) |
290 | mData->birthday = ad.mData->birthday; | 290 | mData->birthday = ad.mData->birthday; |
291 | if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; | 291 | if ( mData->mailer.isEmpty() ) mData->mailer = ad.mData->mailer; |
292 | #if 0 | 292 | if ( !mData->timeZone.isValid() ) mData->timeZone = ad.mData->timeZone; |
293 | if ( !mData->timeZone.isValid() ) l.append( mData->timeZone.asString() ); | 293 | if ( !mData->geo.isValid() ) mData->geo = ad.mData->geo; |
294 | if ( mData->geo.isValid() ) l.append( mData->geo.asString() ); | 294 | if ( mData->title .isEmpty() ) mData->title = ad.mData->title ; |
295 | if ( !mData->title .isEmpty() ) l.append( mData->title ); | 295 | if ( mData->role.isEmpty() ) mData->role = ad.mData->role ; |
296 | if ( !mData->role.isEmpty() ) l.append( mData->role ); | 296 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; |
297 | if ( !mData->organization.isEmpty() ) l.append( mData->organization ); | 297 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; |
298 | if ( !mData->note.isEmpty() ) l.append( mData->note ); | 298 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; |
299 | if ( !mData->productId.isEmpty() ) l.append(mData->productId ); | 299 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; |
300 | if ( !mData->sortString.isEmpty() ) l.append( mData->sortString ); | 300 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; |
301 | if ( mData->secrecy.isValid() ) l.append( mData->secrecy.asString()); | 301 | if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; |
302 | #endif | 302 | |
303 | // pending: | ||
304 | // merging phonenumbers | ||
305 | // merging addresses | ||
306 | // merging emails; | ||
307 | // merging categories; | ||
308 | // merging custom; | ||
309 | // merging keys | ||
303 | } | 310 | } |
304 | 311 | ||
305 | void Addressee::removeID(const QString &prof) | 312 | void Addressee::removeID(const QString &prof) |
306 | { | 313 | { |
307 | detach(); | 314 | detach(); |
308 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); | 315 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); |
309 | 316 | ||
310 | } | 317 | } |
311 | void Addressee::setID( const QString & prof , const QString & id ) | 318 | void Addressee::setID( const QString & prof , const QString & id ) |
312 | { | 319 | { |
313 | detach(); | 320 | detach(); |
314 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); | 321 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); |
315 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 322 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
316 | } | 323 | } |
317 | void Addressee::setTempSyncStat( int id ) | 324 | void Addressee::setTempSyncStat( int id ) |
318 | { | 325 | { |