author | zautrix <zautrix> | 2005-01-26 00:32:18 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-26 00:32:18 (UTC) |
commit | c3ec0a5a43fb328f2d190b8adee1ef662746fb41 (patch) (unidiff) | |
tree | dd34f587205f8567a59bf7abb6161e1ba6667444 /kaddressbook | |
parent | eeb9059d1cbf2ffb13300d0491b4b61126507373 (diff) | |
download | kdepimpi-c3ec0a5a43fb328f2d190b8adee1ef662746fb41.zip kdepimpi-c3ec0a5a43fb328f2d190b8adee1ef662746fb41.tar.gz kdepimpi-c3ec0a5a43fb328f2d190b8adee1ef662746fb41.tar.bz2 |
debug fixes
-rw-r--r-- | kaddressbook/kabcore.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 590cc82..ae0a068 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -422,38 +422,38 @@ KABCore::~KABCore() | |||
422 | delete syncManager; | 422 | delete syncManager; |
423 | #ifndef DESKTOP_VERSION | 423 | #ifndef DESKTOP_VERSION |
424 | if ( infrared ) | 424 | if ( infrared ) |
425 | delete infrared; | 425 | delete infrared; |
426 | #endif | 426 | #endif |
427 | } | 427 | } |
428 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) | 428 | void KABCore::receive( const QCString& cmsg, const QByteArray& data ) |
429 | { | 429 | { |
430 | qDebug("KA: QCOP message received: %s ", cmsg.data() ); | 430 | //qDebug("KA: QCOP message received: %s ", cmsg.data() ); |
431 | if ( cmsg == "setDocument(QString)" ) { | 431 | if ( cmsg == "setDocument(QString)" ) { |
432 | QDataStream stream( data, IO_ReadOnly ); | 432 | QDataStream stream( data, IO_ReadOnly ); |
433 | QString fileName; | 433 | QString fileName; |
434 | stream >> fileName; | 434 | stream >> fileName; |
435 | recieve( fileName ); | 435 | recieve( fileName ); |
436 | return; | 436 | return; |
437 | } | 437 | } |
438 | } | 438 | } |
439 | void KABCore::toggleBeamReceive( ) | 439 | void KABCore::toggleBeamReceive( ) |
440 | { | 440 | { |
441 | if ( mBRdisabled ) | 441 | if ( mBRdisabled ) |
442 | return; | 442 | return; |
443 | #ifndef DESKTOP_VERSION | 443 | #ifndef DESKTOP_VERSION |
444 | if ( infrared ) { | 444 | if ( infrared ) { |
445 | qDebug("AB disable BeamReceive "); | 445 | qDebug("KA: AB disable BeamReceive "); |
446 | delete infrared; | 446 | delete infrared; |
447 | infrared = 0; | 447 | infrared = 0; |
448 | mActionBR->setChecked(false); | 448 | mActionBR->setChecked(false); |
449 | return; | 449 | return; |
450 | } | 450 | } |
451 | qDebug("AB enable BeamReceive "); | 451 | qDebug("KA: AB enable BeamReceive "); |
452 | mActionBR->setChecked(true); | 452 | mActionBR->setChecked(true); |
453 | 453 | ||
454 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; | 454 | infrared = new QCopChannel("QPE/Application/addressbook",this, "channelAB" ) ; |
455 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); | 455 | QObject::connect( infrared, SIGNAL (received ( const QCString &, const QByteArray & )),this, SLOT(receive( const QCString&, const QByteArray& ))); |
456 | #endif | 456 | #endif |
457 | } | 457 | } |
458 | 458 | ||
459 | 459 | ||
@@ -563,17 +563,17 @@ void KABCore::saveSettings() | |||
563 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); | 563 | KABPrefs::instance()->mExtensionsSplitter = mExtensionBarSplitter->sizes(); |
564 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); | 564 | KABPrefs::instance()->mDetailsSplitter = mDetailsSplitter->sizes(); |
565 | #endif //KAB_EMBEDDED | 565 | #endif //KAB_EMBEDDED |
566 | mExtensionManager->saveSettings(); | 566 | mExtensionManager->saveSettings(); |
567 | mViewManager->saveSettings(); | 567 | mViewManager->saveSettings(); |
568 | 568 | ||
569 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); | 569 | KABPrefs::instance()->mCurrentIncSearchField = mIncSearchWidget->currentItem(); |
570 | KABPrefs::instance()->writeConfig(); | 570 | KABPrefs::instance()->writeConfig(); |
571 | qDebug("KABCore::saveSettings() "); | 571 | qDebug("KA: KABCore::saveSettings() "); |
572 | } | 572 | } |
573 | 573 | ||
574 | KABC::AddressBook *KABCore::addressBook() const | 574 | KABC::AddressBook *KABCore::addressBook() const |
575 | { | 575 | { |
576 | return mAddressBook; | 576 | return mAddressBook; |
577 | } | 577 | } |
578 | 578 | ||
579 | KConfig *KABCore::config() | 579 | KConfig *KABCore::config() |
@@ -901,17 +901,17 @@ QString KABCore::getPhoneFile() | |||
901 | #endif | 901 | #endif |
902 | 902 | ||
903 | } | 903 | } |
904 | void KABCore::writeToPhone( ) | 904 | void KABCore::writeToPhone( ) |
905 | { | 905 | { |
906 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) | 906 | if ( PhoneAccess::writeToPhone( getPhoneFile() ) ) |
907 | message(i18n("Export to phone finished!")); | 907 | message(i18n("Export to phone finished!")); |
908 | else | 908 | else |
909 | qDebug(i18n("Error exporting to phone")); | 909 | qDebug(i18n("KA: Error exporting to phone")); |
910 | } | 910 | } |
911 | void KABCore::beamVCard() | 911 | void KABCore::beamVCard() |
912 | { | 912 | { |
913 | QStringList uids; | 913 | QStringList uids; |
914 | XXPortSelectDialog dlg( this, false, this ); | 914 | XXPortSelectDialog dlg( this, false, this ); |
915 | if ( dlg.exec() ) | 915 | if ( dlg.exec() ) |
916 | uids = dlg.uids(); | 916 | uids = dlg.uids(); |
917 | else | 917 | else |
@@ -972,17 +972,17 @@ void KABCore::beamVCard(const QStringList& uids) | |||
972 | //t.setEncoding( QTextStream::UnicodeUTF8 ); | 972 | //t.setEncoding( QTextStream::UnicodeUTF8 ); |
973 | t.setEncoding( QTextStream::Latin1 ); | 973 | t.setEncoding( QTextStream::Latin1 ); |
974 | t <<datastream.latin1(); | 974 | t <<datastream.latin1(); |
975 | outFile.close(); | 975 | outFile.close(); |
976 | Ir *ir = new Ir( this ); | 976 | Ir *ir = new Ir( this ); |
977 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); | 977 | connect( ir, SIGNAL( done(Ir*) ), this, SLOT( beamDone(Ir*) ) ); |
978 | ir->send( fileName, description, "text/x-vCard" ); | 978 | ir->send( fileName, description, "text/x-vCard" ); |
979 | } else { | 979 | } else { |
980 | qDebug("Error open temp beam file "); | 980 | qDebug("KA: Error open temp beam file "); |
981 | return; | 981 | return; |
982 | } | 982 | } |
983 | #endif | 983 | #endif |
984 | 984 | ||
985 | } | 985 | } |
986 | 986 | ||
987 | void KABCore::beamDone( Ir *ir ) | 987 | void KABCore::beamDone( Ir *ir ) |
988 | { | 988 | { |
@@ -2679,17 +2679,17 @@ void KABCore::faq() | |||
2679 | KABC::Addressee KABCore::getLastSyncAddressee() | 2679 | KABC::Addressee KABCore::getLastSyncAddressee() |
2680 | { | 2680 | { |
2681 | Addressee lse; | 2681 | Addressee lse; |
2682 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2682 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2683 | 2683 | ||
2684 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); | 2684 | //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); |
2685 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2685 | lse = mAddressBook->findByUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2686 | if (lse.isEmpty()) { | 2686 | if (lse.isEmpty()) { |
2687 | qDebug("Creating new last-syncAddressee "); | 2687 | qDebug("KA: Creating new last-syncAddressee "); |
2688 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); | 2688 | lse.setUid( "last-syncAddressee-"+mCurrentSyncDevice ); |
2689 | QString sum = ""; | 2689 | QString sum = ""; |
2690 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) | 2690 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) |
2691 | sum = "E: "; | 2691 | sum = "E: "; |
2692 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); | 2692 | lse.setFamilyName("!"+sum+mCurrentSyncDevice + i18n(" - sync event")); |
2693 | lse.setRevision( mLastAddressbookSync ); | 2693 | lse.setRevision( mLastAddressbookSync ); |
2694 | lse.setCategories( i18n("SyncEvent") ); | 2694 | lse.setCategories( i18n("SyncEvent") ); |
2695 | mAddressBook->insertAddressee( lse ); | 2695 | mAddressBook->insertAddressee( lse ); |
@@ -2713,18 +2713,18 @@ int KABCore::takeAddressee( KABC::Addressee* local, KABC::Addressee* remote, i | |||
2713 | QDateTime localMod = local->revision(); | 2713 | QDateTime localMod = local->revision(); |
2714 | QDateTime remoteMod = remote->revision(); | 2714 | QDateTime remoteMod = remote->revision(); |
2715 | 2715 | ||
2716 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); | 2716 | QString mCurrentSyncDevice = syncManager->getCurrentSyncDevice(); |
2717 | 2717 | ||
2718 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2718 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2719 | bool remCh, locCh; | 2719 | bool remCh, locCh; |
2720 | remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); | 2720 | remCh = ( remote->getCsum(mCurrentSyncDevice) != local->getCsum(mCurrentSyncDevice) ); |
2721 | if ( remCh ) | 2721 | //if ( remCh ) |
2722 | qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); | 2722 | // qDebug("loc %s rem %s", local->getCsum(mCurrentSyncDevice).latin1(), remote->getCsum(mCurrentSyncDevice).latin1() ); |
2723 | locCh = ( localMod > mLastAddressbookSync ); | 2723 | locCh = ( localMod > mLastAddressbookSync ); |
2724 | //qDebug("cahnged rem %d loc %d",remCh, locCh ); | 2724 | //qDebug("cahnged rem %d loc %d",remCh, locCh ); |
2725 | if ( !remCh && ! locCh ) { | 2725 | if ( !remCh && ! locCh ) { |
2726 | //qDebug("both not changed "); | 2726 | //qDebug("both not changed "); |
2727 | lastSync = localMod.addDays(1); | 2727 | lastSync = localMod.addDays(1); |
2728 | if ( mode <= SYNC_PREF_ASK ) | 2728 | if ( mode <= SYNC_PREF_ASK ) |
2729 | return 0; | 2729 | return 0; |
2730 | } else { | 2730 | } else { |
@@ -2851,24 +2851,24 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
2851 | //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees(); | 2851 | //KABC::Addressee::List addresseeLSyncSharp = local->getExternLastSyncAddressees(); |
2852 | bool fullDateRange = false; | 2852 | bool fullDateRange = false; |
2853 | local->resetTempSyncStat(); | 2853 | local->resetTempSyncStat(); |
2854 | mLastAddressbookSync = QDateTime::currentDateTime(); | 2854 | mLastAddressbookSync = QDateTime::currentDateTime(); |
2855 | if ( syncManager->syncWithDesktop() ) { | 2855 | if ( syncManager->syncWithDesktop() ) { |
2856 | // remote->removeSyncInfo( QString());//remove all info | 2856 | // remote->removeSyncInfo( QString());//remove all info |
2857 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { | 2857 | if ( KSyncManager::mRequestedSyncEvent.isValid() ) { |
2858 | mLastAddressbookSync = KSyncManager::mRequestedSyncEvent; | 2858 | mLastAddressbookSync = KSyncManager::mRequestedSyncEvent; |
2859 | qDebug("using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() ); | 2859 | qDebug("KA: using extern time for calendar sync: %s ", mLastAddressbookSync.toString().latin1() ); |
2860 | } else { | 2860 | } else { |
2861 | qDebug("KSyncManager::mRequestedSyncEvent has invalid datatime "); | 2861 | qDebug("KA: KSyncManager::mRequestedSyncEvent has invalid datatime "); |
2862 | } | 2862 | } |
2863 | } | 2863 | } |
2864 | QDateTime modifiedCalendar = mLastAddressbookSync; | 2864 | QDateTime modifiedCalendar = mLastAddressbookSync; |
2865 | addresseeLSync = getLastSyncAddressee(); | 2865 | addresseeLSync = getLastSyncAddressee(); |
2866 | qDebug("Last Sync %s ", addresseeLSync.revision().toString().latin1()); | 2866 | qDebug("KA: Last Sync %s ", addresseeLSync.revision().toString().latin1()); |
2867 | addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName ); | 2867 | addresseeR = remote->findByUid("last-syncAddressee-"+mCurrentSyncName ); |
2868 | if ( !addresseeR.isEmpty() ) { | 2868 | if ( !addresseeR.isEmpty() ) { |
2869 | addresseeRSync = addresseeR; | 2869 | addresseeRSync = addresseeR; |
2870 | remote->removeAddressee(addresseeR ); | 2870 | remote->removeAddressee(addresseeR ); |
2871 | 2871 | ||
2872 | } else { | 2872 | } else { |
2873 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { | 2873 | if ( mGlobalSyncMode == SYNC_MODE_EXTERNAL ) { |
2874 | addresseeRSync = addresseeLSync ; | 2874 | addresseeRSync = addresseeLSync ; |
@@ -3120,17 +3120,17 @@ bool KABCore::synchronizeAddressbooks( KABC::AddressBook* local, KABC::AddressBo | |||
3120 | local->insertAddressee( addresseeLSync, false ); | 3120 | local->insertAddressee( addresseeLSync, false ); |
3121 | QString mes; | 3121 | QString mes; |
3122 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR, filteredIN, filteredOUT ); | 3122 | mes .sprintf( i18n("Synchronization summary:\n\n %d items added to local\n %d items added to remote\n %d items updated on local\n %d items updated on remote\n %d items deleted on local\n %d items deleted on remote\n %d incoming filtered out\n %d outgoing filtered out"),addedAddressee, addedAddresseeR, changedLocal, changedRemote, deletedAddresseeL, deletedAddresseeR, filteredIN, filteredOUT ); |
3123 | qDebug( mes ); | 3123 | qDebug( mes ); |
3124 | mes = i18n("Local addressbook changed!\n") +mes; | 3124 | mes = i18n("Local addressbook changed!\n") +mes; |
3125 | if ( syncManager->mShowSyncSummary ) { | 3125 | if ( syncManager->mShowSyncSummary ) { |
3126 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, | 3126 | if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, mes, |
3127 | i18n("KA/Pi Synchronization"),i18n("Write back"))) { | 3127 | i18n("KA/Pi Synchronization"),i18n("Write back"))) { |
3128 | qDebug("cancelled "); | 3128 | qDebug("KA: WB cancelled "); |
3129 | return false; | 3129 | return false; |
3130 | } | 3130 | } |
3131 | } | 3131 | } |
3132 | return syncOK; | 3132 | return syncOK; |
3133 | } | 3133 | } |
3134 | 3134 | ||
3135 | 3135 | ||
3136 | //this is a overwritten callbackmethods from the syncinterface | 3136 | //this is a overwritten callbackmethods from the syncinterface |
@@ -3142,27 +3142,27 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | |||
3142 | mGlobalSyncMode = SYNC_MODE_NORMAL; | 3142 | mGlobalSyncMode = SYNC_MODE_NORMAL; |
3143 | if ( manager != syncManager ) | 3143 | if ( manager != syncManager ) |
3144 | qDebug("KABCore::sync:: ERROR! :: manager != syncManager "); | 3144 | qDebug("KABCore::sync:: ERROR! :: manager != syncManager "); |
3145 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 3145 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
3146 | 3146 | ||
3147 | AddressBook abLocal(filename,"syncContact"); | 3147 | AddressBook abLocal(filename,"syncContact"); |
3148 | bool syncOK = false; | 3148 | bool syncOK = false; |
3149 | if ( abLocal.load() ) { | 3149 | if ( abLocal.load() ) { |
3150 | qDebug("Sync:AB loaded %s,sync mode %d",filename.latin1(), mode ); | 3150 | qDebug("KA: Sync::AB loaded %s,sync mode %d",filename.latin1(), mode ); |
3151 | bool external = false; | 3151 | bool external = false; |
3152 | bool isXML = false; | 3152 | bool isXML = false; |
3153 | if ( filename.right(4) == ".xml") { | 3153 | if ( filename.right(4) == ".xml") { |
3154 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3154 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3155 | isXML = true; | 3155 | isXML = true; |
3156 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 3156 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
3157 | } else { | 3157 | } else { |
3158 | external = !manager->mIsKapiFile; | 3158 | external = !manager->mIsKapiFile; |
3159 | if ( external ) { | 3159 | if ( external ) { |
3160 | qDebug("Sync:Setting vcf mode to external "); | 3160 | qDebug("KA: Sync::Setting vcf mode to external "); |
3161 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3161 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3162 | AddressBook::Iterator it; | 3162 | AddressBook::Iterator it; |
3163 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { | 3163 | for ( it = abLocal.begin(); it != abLocal.end(); ++it ) { |
3164 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); | 3164 | (*it).setID( mCurrentSyncDevice, (*it).uid() ); |
3165 | (*it).computeCsum( mCurrentSyncDevice ); | 3165 | (*it).computeCsum( mCurrentSyncDevice ); |
3166 | } | 3166 | } |
3167 | } | 3167 | } |
3168 | } | 3168 | } |
@@ -3172,19 +3172,19 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | |||
3172 | // qDebug("Name %s ", (*it).familyName().latin1()); | 3172 | // qDebug("Name %s ", (*it).familyName().latin1()); |
3173 | //} | 3173 | //} |
3174 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); | 3174 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); |
3175 | if ( syncOK ) { | 3175 | if ( syncOK ) { |
3176 | if ( syncManager->mWriteBackFile ) | 3176 | if ( syncManager->mWriteBackFile ) |
3177 | { | 3177 | { |
3178 | if ( external ) | 3178 | if ( external ) |
3179 | abLocal.removeSyncAddressees( !isXML); | 3179 | abLocal.removeSyncAddressees( !isXML); |
3180 | qDebug("Sync:Saving remote AB "); | 3180 | qDebug("KA: Sync::Saving remote AB "); |
3181 | if ( ! abLocal.saveAB()) | 3181 | if ( ! abLocal.saveAB()) |
3182 | qDebug("Error writing back AB to file "); | 3182 | qDebug("KA: sync::Error writing back AB to file "); |
3183 | if ( external ) { | 3183 | if ( external ) { |
3184 | // afterwrite processing | 3184 | // afterwrite processing |
3185 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); | 3185 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ,isXML); |
3186 | } | 3186 | } |
3187 | } | 3187 | } |
3188 | } | 3188 | } |
3189 | setModified(); | 3189 | setModified(); |
3190 | 3190 | ||
@@ -3192,17 +3192,17 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | |||
3192 | abLocal.removeResources(); | 3192 | abLocal.removeResources(); |
3193 | if ( syncOK ) | 3193 | if ( syncOK ) |
3194 | mViewManager->refreshView(); | 3194 | mViewManager->refreshView(); |
3195 | return syncOK; | 3195 | return syncOK; |
3196 | 3196 | ||
3197 | } | 3197 | } |
3198 | void KABCore::removeSyncInfo( QString syncProfile) | 3198 | void KABCore::removeSyncInfo( QString syncProfile) |
3199 | { | 3199 | { |
3200 | qDebug("AB:removeSyncInfo for profile %s ", syncProfile.latin1()); | 3200 | qDebug("KA: AB:removeSyncInfo for profile %s ", syncProfile.latin1()); |
3201 | mAddressBook->removeSyncInfo( syncProfile ); | 3201 | mAddressBook->removeSyncInfo( syncProfile ); |
3202 | setModified(); | 3202 | setModified(); |
3203 | } | 3203 | } |
3204 | 3204 | ||
3205 | 3205 | ||
3206 | //this is a overwritten callbackmethods from the syncinterface | 3206 | //this is a overwritten callbackmethods from the syncinterface |
3207 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) | 3207 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) |
3208 | { | 3208 | { |
@@ -3212,17 +3212,17 @@ bool KABCore::syncExternal(KSyncManager* manager, QString resource) | |||
3212 | if ( manager != syncManager ) | 3212 | if ( manager != syncManager ) |
3213 | qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager "); | 3213 | qDebug("KABCore::syncExternal:: ERROR! :: manager != syncManager "); |
3214 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 3214 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
3215 | 3215 | ||
3216 | AddressBook abLocal( resource,"syncContact"); | 3216 | AddressBook abLocal( resource,"syncContact"); |
3217 | bool syncOK = false; | 3217 | bool syncOK = false; |
3218 | message(i18n("Loading DTM address data..."), false); | 3218 | message(i18n("Loading DTM address data..."), false); |
3219 | if ( abLocal.load() ) { | 3219 | if ( abLocal.load() ) { |
3220 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 3220 | qDebug("KA: AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
3221 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3221 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3222 | message(i18n("Sync preprocessing..."),false); | 3222 | message(i18n("Sync preprocessing..."),false); |
3223 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); | 3223 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, false ); |
3224 | message(i18n("Synchronizing..."),false); | 3224 | message(i18n("Synchronizing..."),false); |
3225 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 3225 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
3226 | if ( syncOK ) { | 3226 | if ( syncOK ) { |
3227 | if ( syncManager->mWriteBackFile ) { | 3227 | if ( syncManager->mWriteBackFile ) { |
3228 | abLocal.removeSyncAddressees( false ); | 3228 | abLocal.removeSyncAddressees( false ); |
@@ -3260,17 +3260,17 @@ bool KABCore::syncPhone() | |||
3260 | if ( !PhoneAccess::readFromPhone( fileName) ) { | 3260 | if ( !PhoneAccess::readFromPhone( fileName) ) { |
3261 | message(i18n("Phone access failed!")); | 3261 | message(i18n("Phone access failed!")); |
3262 | return false; | 3262 | return false; |
3263 | } | 3263 | } |
3264 | AddressBook abLocal( fileName,"syncContact"); | 3264 | AddressBook abLocal( fileName,"syncContact"); |
3265 | bool syncOK = false; | 3265 | bool syncOK = false; |
3266 | { | 3266 | { |
3267 | abLocal.importFromFile( fileName ); | 3267 | abLocal.importFromFile( fileName ); |
3268 | qDebug("AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 3268 | qDebug("KA: AB phone loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
3269 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 3269 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
3270 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); | 3270 | abLocal.preparePhoneSync( mCurrentSyncDevice, true ); |
3271 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); | 3271 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice, true ); |
3272 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 3272 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
3273 | if ( syncOK ) { | 3273 | if ( syncOK ) { |
3274 | if ( syncManager->mWriteBackFile ) { | 3274 | if ( syncManager->mWriteBackFile ) { |
3275 | abLocal.removeSyncAddressees( true ); | 3275 | abLocal.removeSyncAddressees( true ); |
3276 | abLocal.saveABphone( fileName ); | 3276 | abLocal.saveABphone( fileName ); |