-rw-r--r-- | kabc/addressee.cpp | 1 | ||||
-rw-r--r-- | kabc/plugins/sharpdtm/resourcesharpdtm.cpp | 1 | ||||
-rw-r--r-- | kabc/plugins/sharpdtm/sharpdtmconverter.cpp | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/kabc/addressee.cpp b/kabc/addressee.cpp index 31ce1d6..25c77f6 100644 --- a/kabc/addressee.cpp +++ b/kabc/addressee.cpp | |||
@@ -299,32 +299,33 @@ void Addressee::mergeContact( const Addressee& ad ) | |||
299 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; | 299 | if ( mData->organization.isEmpty() ) mData->organization = ad.mData->organization ; |
300 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; | 300 | if ( mData->note.isEmpty() ) mData->note = ad.mData->note ; |
301 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; | 301 | if ( mData->productId.isEmpty() ) mData->productId = ad.mData->productId; |
302 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; | 302 | if ( mData->sortString.isEmpty() ) mData->sortString = ad.mData->sortString; |
303 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; | 303 | if ( !mData->secrecy.isValid() ) mData->secrecy = ad.mData->secrecy; |
304 | if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; | 304 | if ( ( !mData->url.isValid() && ad.mData->url.isValid() ) ) mData->url = ad.mData->url ; |
305 | 305 | ||
306 | // pending: | 306 | // pending: |
307 | // merging phonenumbers | 307 | // merging phonenumbers |
308 | // merging addresses | 308 | // merging addresses |
309 | // merging emails; | 309 | // merging emails; |
310 | // merging categories; | 310 | // merging categories; |
311 | // merging custom; | 311 | // merging custom; |
312 | // merging keys | 312 | // merging keys |
313 | qDebug("merge contact %s ", ad.uid().latin1()); | 313 | qDebug("merge contact %s ", ad.uid().latin1()); |
314 | setUid( ad.uid() ); | 314 | setUid( ad.uid() ); |
315 | setRevision( ad.revision() ); | ||
315 | } | 316 | } |
316 | 317 | ||
317 | void Addressee::removeID(const QString &prof) | 318 | void Addressee::removeID(const QString &prof) |
318 | { | 319 | { |
319 | detach(); | 320 | detach(); |
320 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); | 321 | mData->mExternalId = KIdManager::removeId ( mData->mExternalId, prof); |
321 | 322 | ||
322 | } | 323 | } |
323 | void Addressee::setID( const QString & prof , const QString & id ) | 324 | void Addressee::setID( const QString & prof , const QString & id ) |
324 | { | 325 | { |
325 | detach(); | 326 | detach(); |
326 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); | 327 | mData->mExternalId = KIdManager::setId ( mData->mExternalId, prof, id ); |
327 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); | 328 | //qDebug("setID2 %s %s %s",mData->mExternalId.latin1(), prof.latin1(), id.latin1() ); |
328 | } | 329 | } |
329 | void Addressee::setTempSyncStat( int id ) | 330 | void Addressee::setTempSyncStat( int id ) |
330 | { | 331 | { |
diff --git a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp index 437bda8..adc7256 100644 --- a/kabc/plugins/sharpdtm/resourcesharpdtm.cpp +++ b/kabc/plugins/sharpdtm/resourcesharpdtm.cpp | |||
@@ -285,33 +285,32 @@ bool ResourceSharpDTM::save( Ticket *ticket ) | |||
285 | #endif | 285 | #endif |
286 | if (res == false) | 286 | if (res == false) |
287 | qDebug("Unable to append Contact: %s", addressee.formattedName().latin1()); | 287 | qDebug("Unable to append Contact: %s", addressee.formattedName().latin1()); |
288 | 288 | ||
289 | } | 289 | } |
290 | else | 290 | else |
291 | { | 291 | { |
292 | qDebug("Unable to convert Addressee: %s", addressee.formattedName().latin1()); | 292 | qDebug("Unable to convert Addressee: %s", addressee.formattedName().latin1()); |
293 | mAccess->cancelEditCard(); | 293 | mAccess->cancelEditCard(); |
294 | } | 294 | } |
295 | } | 295 | } |
296 | } | 296 | } |
297 | } | 297 | } |
298 | 298 | ||
299 | } | 299 | } |
300 | AddresseeMap::Iterator itam; | 300 | AddresseeMap::Iterator itam; |
301 | res; | ||
302 | for ( res=mAccess->first(); res == true; res=mAccess->next()) | 301 | for ( res=mAccess->first(); res == true; res=mAccess->next()) |
303 | { | 302 | { |
304 | id = mAccess->cardId(); | 303 | id = mAccess->cardId(); |
305 | int idint = id; | 304 | int idint = id; |
306 | itam = map.find( idint ); | 305 | itam = map.find( idint ); |
307 | if ( itam != map.end() ) { | 306 | if ( itam != map.end() ) { |
308 | KABC::Addressee addressee; | 307 | KABC::Addressee addressee; |
309 | qDebug("found change %d %s ", idint, itam.data().latin1()); | 308 | qDebug("found change %d %s ", idint, itam.data().latin1()); |
310 | res = mConverter->sharpToAddressee( id, mAccess, addressee ); | 309 | res = mConverter->sharpToAddressee( id, mAccess, addressee ); |
311 | 310 | ||
312 | if ( !addressee.isEmpty() && res ) | 311 | if ( !addressee.isEmpty() && res ) |
313 | { | 312 | { |
314 | addressee.setResource( this ); | 313 | addressee.setResource( this ); |
315 | addressee.setUid( itam.data() ); | 314 | addressee.setUid( itam.data() ); |
316 | addressee.setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); | 315 | addressee.setTempSyncStat( SYNC_TEMPSTATE_NEW_ID ); |
317 | addressBook()->insertAddressee( addressee , false ); | 316 | addressBook()->insertAddressee( addressee , false ); |
diff --git a/kabc/plugins/sharpdtm/sharpdtmconverter.cpp b/kabc/plugins/sharpdtm/sharpdtmconverter.cpp index fccf625..d36df20 100644 --- a/kabc/plugins/sharpdtm/sharpdtmconverter.cpp +++ b/kabc/plugins/sharpdtm/sharpdtmconverter.cpp | |||
@@ -299,59 +299,61 @@ bool SharpDTMConverter::addresseeToSharp( const Addressee &addr, SlZDataBase* da | |||
299 | } | 299 | } |
300 | database->writeField(ZdbAdrs::FileAs, formattedName); | 300 | database->writeField(ZdbAdrs::FileAs, formattedName); |
301 | database->writeField(ZdbAdrs::FullName, formattedName); | 301 | database->writeField(ZdbAdrs::FullName, formattedName); |
302 | 302 | ||
303 | 303 | ||
304 | //qDebug("SharpDTMConverter::addresseeToSharp check which seperator we need here for the emails!!"); | 304 | //qDebug("SharpDTMConverter::addresseeToSharp check which seperator we need here for the emails!!"); |
305 | //qDebug("SharpDTMConverter::addresseeToSharp its probably the same from sharpToAddressee"); | 305 | //qDebug("SharpDTMConverter::addresseeToSharp its probably the same from sharpToAddressee"); |
306 | QString emails = addr.emails().join(" "); | 306 | QString emails = addr.emails().join(" "); |
307 | database->writeField(ZdbAdrs::Emails, emails ); | 307 | database->writeField(ZdbAdrs::Emails, emails ); |
308 | 308 | ||
309 | database->writeField(ZdbAdrs::DefaultEmail, addr.preferredEmail() ); | 309 | database->writeField(ZdbAdrs::DefaultEmail, addr.preferredEmail() ); |
310 | 310 | ||
311 | 311 | ||
312 | // home | 312 | // home |
313 | const Address homeaddress = addr.address(Address::Home); | 313 | const Address homeaddress = addr.address(Address::Home); |
314 | if (!homeaddress.isEmpty()) { | 314 | if (!homeaddress.isEmpty()) { |
315 | qDebug("write home address "); | ||
315 | database->writeField(ZdbAdrs::HomeStreet, homeaddress.street()); | 316 | database->writeField(ZdbAdrs::HomeStreet, homeaddress.street()); |
316 | database->writeField(ZdbAdrs::HomeCity, homeaddress.locality()); | 317 | database->writeField(ZdbAdrs::HomeCity, homeaddress.locality()); |
317 | database->writeField(ZdbAdrs::HomeState, homeaddress.region()); | 318 | database->writeField(ZdbAdrs::HomeState, homeaddress.region()); |
318 | database->writeField(ZdbAdrs::HomeZip, homeaddress.postalCode()); | 319 | database->writeField(ZdbAdrs::HomeZip, homeaddress.postalCode()); |
319 | database->writeField(ZdbAdrs::HomeCountry, homeaddress.country()); | 320 | database->writeField(ZdbAdrs::HomeCountry, homeaddress.country()); |
320 | } | 321 | } |
321 | 322 | ||
322 | PhoneNumber homephone = addr.phoneNumber( PhoneNumber::Home ); | 323 | PhoneNumber homephone = addr.phoneNumber( PhoneNumber::Home ); |
323 | if (!homephone.number().isEmpty()) | 324 | if (!homephone.number().isEmpty()) |
324 | database->writeField(ZdbAdrs::HomePhone, homephone.number()); | 325 | database->writeField(ZdbAdrs::HomePhone, homephone.number()); |
325 | 326 | ||
326 | PhoneNumber homefax = addr.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ); | 327 | PhoneNumber homefax = addr.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ); |
327 | if (!homefax.number().isEmpty()) | 328 | if (!homefax.number().isEmpty()) |
328 | database->writeField(ZdbAdrs::HomeFax, homefax.number()); | 329 | database->writeField(ZdbAdrs::HomeFax, homefax.number()); |
329 | 330 | ||
330 | PhoneNumber homemobile = addr.phoneNumber( PhoneNumber::Home | PhoneNumber::Cell ); | 331 | PhoneNumber homemobile = addr.phoneNumber( PhoneNumber::Home | PhoneNumber::Cell ); |
331 | if (!homemobile.number().isEmpty()) { | 332 | if (!homemobile.number().isEmpty()) { |
332 | database->writeField(ZdbAdrs::HomeMobile, homemobile.number()); | 333 | database->writeField(ZdbAdrs::HomeMobile, homemobile.number()); |
333 | cellHome = true; | 334 | cellHome = true; |
334 | } | 335 | } |
335 | 336 | ||
336 | database->writeField(ZdbAdrs::HomeWebPage, addr.url().url()); | 337 | database->writeField(ZdbAdrs::HomeWebPage, addr.url().url()); |
337 | 338 | ||
338 | 339 | ||
339 | // business | 340 | // business |
340 | const Address businessaddress = addr.address(Address::Work); | 341 | const Address businessaddress = addr.address(Address::Work); |
341 | if (!businessaddress.isEmpty()) { | 342 | if (!businessaddress.isEmpty()) { |
343 | qDebug("write business address "); | ||
342 | database->writeField(ZdbAdrs::BusinessStreet, businessaddress.street()); | 344 | database->writeField(ZdbAdrs::BusinessStreet, businessaddress.street()); |
343 | database->writeField(ZdbAdrs::BusinessCity, businessaddress.locality()); | 345 | database->writeField(ZdbAdrs::BusinessCity, businessaddress.locality()); |
344 | database->writeField(ZdbAdrs::BusinessState, businessaddress.region()); | 346 | database->writeField(ZdbAdrs::BusinessState, businessaddress.region()); |
345 | database->writeField(ZdbAdrs::BusinessZip, businessaddress.postalCode()); | 347 | database->writeField(ZdbAdrs::BusinessZip, businessaddress.postalCode()); |
346 | database->writeField(ZdbAdrs::BusinessCountry, businessaddress.country()); | 348 | database->writeField(ZdbAdrs::BusinessCountry, businessaddress.country()); |
347 | } | 349 | } |
348 | 350 | ||
349 | PhoneNumber businessphone = addr.phoneNumber( PhoneNumber::Work ); | 351 | PhoneNumber businessphone = addr.phoneNumber( PhoneNumber::Work ); |
350 | if (!businessphone.number().isEmpty()) | 352 | if (!businessphone.number().isEmpty()) |
351 | database->writeField(ZdbAdrs::BusinessPhone, businessphone.number()); | 353 | database->writeField(ZdbAdrs::BusinessPhone, businessphone.number()); |
352 | 354 | ||
353 | PhoneNumber businessfax = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ); | 355 | PhoneNumber businessfax = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ); |
354 | if (!businessfax.number().isEmpty()) | 356 | if (!businessfax.number().isEmpty()) |
355 | database->writeField(ZdbAdrs::BusinessFax, businessfax.number()); | 357 | database->writeField(ZdbAdrs::BusinessFax, businessfax.number()); |
356 | 358 | ||
357 | PhoneNumber businessmobile = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Cell ); | 359 | PhoneNumber businessmobile = addr.phoneNumber( PhoneNumber::Work | PhoneNumber::Cell ); |