author | zautrix <zautrix> | 2004-10-09 16:58:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-09 16:58:08 (UTC) |
commit | 59ed933d6c43ecb0ddd3dec53cc289ee8aa68482 (patch) (unidiff) | |
tree | 8b1cbcf9c420e7dffd1e1293bcfa69e8e821f3fa /kaddressbook | |
parent | b80a099d9432bdc3d4eea778b1813b82b2680ecf (diff) | |
download | kdepimpi-59ed933d6c43ecb0ddd3dec53cc289ee8aa68482.zip kdepimpi-59ed933d6c43ecb0ddd3dec53cc289ee8aa68482.tar.gz kdepimpi-59ed933d6c43ecb0ddd3dec53cc289ee8aa68482.tar.bz2 |
fixed sync bug
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 7ec3fca..452f1bc 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -2831,69 +2831,69 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode) | |||
2831 | getEventViewerDialog()->setSyncMode( false ); | 2831 | getEventViewerDialog()->setSyncMode( false ); |
2832 | if ( syncOK ) { | 2832 | if ( syncOK ) { |
2833 | if ( KOPrefs::instance()->mWriteBackFile ) | 2833 | if ( KOPrefs::instance()->mWriteBackFile ) |
2834 | { | 2834 | { |
2835 | storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); | 2835 | storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); |
2836 | storage->save(); | 2836 | storage->save(); |
2837 | } | 2837 | } |
2838 | } | 2838 | } |
2839 | setModified(); | 2839 | setModified(); |
2840 | } | 2840 | } |
2841 | 2841 | ||
2842 | #endif | 2842 | #endif |
2843 | } | 2843 | } |
2844 | 2844 | ||
2845 | 2845 | ||
2846 | //this is a overwritten callbackmethods from the syncinterface | 2846 | //this is a overwritten callbackmethods from the syncinterface |
2847 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) | 2847 | bool KABCore::syncExternal(KSyncManager* manager, QString resource) |
2848 | { | 2848 | { |
2849 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); | 2849 | QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); |
2850 | 2850 | ||
2851 | AddressBook abLocal( resource,"syncContact"); | 2851 | AddressBook abLocal( resource,"syncContact"); |
2852 | bool syncOK = false; | 2852 | bool syncOK = false; |
2853 | if ( abLocal.load() ) { | 2853 | if ( abLocal.load() ) { |
2854 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); | 2854 | qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); |
2855 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; | 2855 | mGlobalSyncMode = SYNC_MODE_EXTERNAL; |
2856 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice ); | 2856 | abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice ); |
2857 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); | 2857 | syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); |
2858 | if ( syncOK ) { | 2858 | if ( syncOK ) { |
2859 | if ( syncManager->mWriteBackFile ) { | 2859 | if ( syncManager->mWriteBackFile ) { |
2860 | abLocal.saveAB(); | 2860 | abLocal.saveAB(); |
2861 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); | 2861 | abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); |
2862 | } | 2862 | } |
2863 | } | 2863 | } |
2864 | setModified(); | 2864 | setModified(); |
2865 | } | 2865 | } |
2866 | if ( syncOK ) | 2866 | if ( syncOK ) |
2867 | mViewManager->refreshView(); | 2867 | mViewManager->refreshView(); |
2868 | return syncOK; | 2868 | return syncOK; |
2869 | 2869 | ||
2870 | } | 2870 | } |
2871 | 2871 | ||
2872 | void KABCore::getFile( bool success ) | 2872 | void KABCore::getFile( bool success ) |
2873 | { | 2873 | { |
2874 | QTimer::singleShot( 15000, this , SLOT ( setCaptionBack())); | 2874 | QTimer::singleShot( 15000, this , SLOT ( setCaptionBack())); |
2875 | if ( ! success ) { | 2875 | if ( ! success ) { |
2876 | setCaption( i18n("Error receiving file. Nothing changed!") ); | 2876 | setCaption( i18n("Error receiving file. Nothing changed!") ); |
2877 | return; | 2877 | return; |
2878 | } | 2878 | } |
2879 | mAddressBook->importFromFile( sentSyncFile() ); | 2879 | mAddressBook->importFromFile( sentSyncFile() , false, true ); |
2880 | topLevelWidget()->setCaption( i18n("Pi-Sync successful!") ); | 2880 | topLevelWidget()->setCaption( i18n("Pi-Sync successful!") ); |
2881 | mViewManager->refreshView(); | 2881 | mViewManager->refreshView(); |
2882 | } | 2882 | } |
2883 | void KABCore::syncFileRequest() | 2883 | void KABCore::syncFileRequest() |
2884 | { | 2884 | { |
2885 | mAddressBook->export2File( sentSyncFile() ); | 2885 | mAddressBook->export2File( sentSyncFile() ); |
2886 | } | 2886 | } |
2887 | QString KABCore::sentSyncFile() | 2887 | QString KABCore::sentSyncFile() |
2888 | { | 2888 | { |
2889 | #ifdef _WIN32_ | 2889 | #ifdef _WIN32_ |
2890 | return locateLocal( "tmp", "copysyncab.vcf" ); | 2890 | return locateLocal( "tmp", "copysyncab.vcf" ); |
2891 | #else | 2891 | #else |
2892 | return QString( "/tmp/copysyncab.vcf" ); | 2892 | return QString( "/tmp/copysyncab.vcf" ); |
2893 | #endif | 2893 | #endif |
2894 | } | 2894 | } |
2895 | 2895 | ||
2896 | void KABCore::setCaptionBack() | 2896 | void KABCore::setCaptionBack() |
2897 | { | 2897 | { |
2898 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); | 2898 | topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); |
2899 | } | 2899 | } |