summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-10-09 16:58:08 (UTC)
committer zautrix <zautrix>2004-10-09 16:58:08 (UTC)
commit59ed933d6c43ecb0ddd3dec53cc289ee8aa68482 (patch) (unidiff)
tree8b1cbcf9c420e7dffd1e1293bcfa69e8e821f3fa /kaddressbook
parentb80a099d9432bdc3d4eea778b1813b82b2680ecf (diff)
downloadkdepimpi-59ed933d6c43ecb0ddd3dec53cc289ee8aa68482.zip
kdepimpi-59ed933d6c43ecb0ddd3dec53cc289ee8aa68482.tar.gz
kdepimpi-59ed933d6c43ecb0ddd3dec53cc289ee8aa68482.tar.bz2
fixed sync bug
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp2
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
@@ -2847,53 +2847,53 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
2847bool KABCore::syncExternal(KSyncManager* manager, QString resource) 2847bool 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
2872void KABCore::getFile( bool success ) 2872void 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}
2883void KABCore::syncFileRequest() 2883void KABCore::syncFileRequest()
2884{ 2884{
2885 mAddressBook->export2File( sentSyncFile() ); 2885 mAddressBook->export2File( sentSyncFile() );
2886} 2886}
2887QString KABCore::sentSyncFile() 2887QString 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
2896void KABCore::setCaptionBack() 2896void KABCore::setCaptionBack()
2897{ 2897{
2898 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); 2898 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") );
2899} 2899}