summaryrefslogtreecommitdiffabout
path: root/kabc/addressee.cpp
Unidiff
Diffstat (limited to 'kabc/addressee.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/addressee.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp
index fda62f1..e241281 100644
--- a/kabc/addressee.cpp
+++ b/kabc/addressee.cpp
@@ -86,25 +86,25 @@ struct Addressee::AddresseeData : public KShared
86 86
87 bool empty :1; 87 bool empty :1;
88 bool changed :1; 88 bool changed :1;
89}; 89};
90 90
91Addressee::Addressee() 91Addressee::Addressee()
92{ 92{
93 mData = new AddresseeData; 93 mData = new AddresseeData;
94 mData->empty = true; 94 mData->empty = true;
95 mData->changed = false; 95 mData->changed = false;
96 mData->resource = 0; 96 mData->resource = 0;
97 mData->mExternalId = ":"; 97 mData->mExternalId = ":";
98 mData->revision = QDateTime ( QDate( 2004,1,1)); 98 mData->revision = QDateTime ( QDate( 2003,1,1));
99 mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL; 99 mData->mTempSyncStat = SYNC_TEMPSTATE_INITIAL;
100} 100}
101 101
102Addressee::~Addressee() 102Addressee::~Addressee()
103{ 103{
104} 104}
105 105
106Addressee::Addressee( const Addressee &a ) 106Addressee::Addressee( const Addressee &a )
107{ 107{
108 mData = a.mData; 108 mData = a.mData;
109} 109}
110 110
@@ -299,24 +299,26 @@ void Addressee::mergeContact( const Addressee& ad )
299 if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; 299 if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId;
300 if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; 300 if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString;
301 if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; 301 if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy;
302 if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; 302 if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ;
303 303
304 // pending: 304 // pending:
305 // merging phonenumbers 305 // merging phonenumbers
306 // merging addresses 306 // merging addresses
307 // merging emails; 307 // merging emails;
308 // merging categories; 308 // merging categories;
309 // merging custom; 309 // merging custom;
310 // merging keys 310 // merging keys
311 qDebug("merge contact %s ", ad.uid().latin1());
312 setUid( ad.uid() );
311} 313}
312 314
313void Addressee::removeID(const QString &prof) 315void Addressee::removeID(const QString &prof)
314{ 316{
315 detach(); 317 detach();
316 mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); 318 mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof);
317 319
318} 320}
319void Addressee::setID( const QString & prof , const QString & id ) 321void Addressee::setID( const QString & prof , const QString & id )
320{ 322{
321 detach(); 323 detach();
322 mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); 324 mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id );
@@ -370,36 +372,38 @@ void Addressee::setExternalUID( const QString &id )
370 mData->externalUID = id; 372 mData->externalUID = id;
371} 373}
372 374
373QString Addressee::externalUID() const 375QString Addressee::externalUID() const
374{ 376{
375 return mData->externalUID; 377 return mData->externalUID;
376} 378}
377void Addressee::setOriginalExternalUID( const QString &id ) 379void Addressee::setOriginalExternalUID( const QString &id )
378{ 380{
379 if ( id == mData->originalExternalUID ) return; 381 if ( id == mData->originalExternalUID ) return;
380 detach(); 382 detach();
381 mData->empty = false; 383 mData->empty = false;
384 qDebug("*******Set orig uid %s ", id.latin1());
382 mData->originalExternalUID = id; 385 mData->originalExternalUID = id;
383} 386}
384 387
385QString Addressee::originalExternalUID() const 388QString Addressee::originalExternalUID() const
386{ 389{
387 return mData->originalExternalUID; 390 return mData->originalExternalUID;
388} 391}
389 392
390void Addressee::setUid( const QString &id ) 393void Addressee::setUid( const QString &id )
391{ 394{
392 if ( id == mData->uid ) return; 395 if ( id == mData->uid ) return;
393 detach(); 396 detach();
397 qDebug("****setuid %s ", id.latin1());
394 mData->empty = false; 398 mData->empty = false;
395 mData->uid = id; 399 mData->uid = id;
396} 400}
397 401
398QString Addressee::uid() const 402QString Addressee::uid() const
399{ 403{
400 if ( mData->uid.isEmpty() ) 404 if ( mData->uid.isEmpty() )
401 mData->uid = KApplication::randomString( 10 ); 405 mData->uid = KApplication::randomString( 10 );
402 406
403 return mData->uid; 407 return mData->uid;
404} 408}
405 409