summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-10-07 17:51:17 (UTC)
committer zautrix <zautrix>2004-10-07 17:51:17 (UTC)
commit1f1538e5707b59bfcff2014901f29a65589229e3 (patch) (unidiff)
tree0d91a303524e6ac9f7c954f01a0e1d09d0e305e7 /kaddressbook
parentbb8293c794d82a57bc93af85ccd89b601356d577 (diff)
downloadkdepimpi-1f1538e5707b59bfcff2014901f29a65589229e3.zip
kdepimpi-1f1538e5707b59bfcff2014901f29a65589229e3.tar.gz
kdepimpi-1f1538e5707b59bfcff2014901f29a65589229e3.tar.bz2
many cleanups
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kabcore.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 12502b0..c5406bf 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -2791,97 +2791,96 @@ bool KABCore::sync(KSyncManager* manager, QString filename, int mode)
2791 // qDebug("Name %s ", (*it).familyName().latin1()); 2791 // qDebug("Name %s ", (*it).familyName().latin1());
2792 //} 2792 //}
2793 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode ); 2793 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, mode );
2794 if ( syncOK ) { 2794 if ( syncOK ) {
2795 if ( syncManager->mWriteBackFile ) 2795 if ( syncManager->mWriteBackFile )
2796 { 2796 {
2797 if ( external ) 2797 if ( external )
2798 abLocal.removeSyncAddressees( !isXML); 2798 abLocal.removeSyncAddressees( !isXML);
2799 qDebug("Saving remote AB "); 2799 qDebug("Saving remote AB ");
2800 abLocal.saveAB(); 2800 abLocal.saveAB();
2801 if ( isXML ) { 2801 if ( isXML ) {
2802 // afterwrite processing 2802 // afterwrite processing
2803 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); 2803 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice );
2804 } 2804 }
2805 } 2805 }
2806 } 2806 }
2807 setModified(); 2807 setModified();
2808 2808
2809 } 2809 }
2810 if ( syncOK ) 2810 if ( syncOK )
2811 mViewManager->refreshView(); 2811 mViewManager->refreshView();
2812 return syncOK; 2812 return syncOK;
2813#if 0 2813#if 0
2814 2814
2815 if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) { 2815 if ( storage->load(KOPrefs::instance()->mUseQuicksave) ) {
2816 getEventViewerDialog()->setSyncMode( true ); 2816 getEventViewerDialog()->setSyncMode( true );
2817 syncOK = synchronizeCalendar( mCalendar, calendar, mode ); 2817 syncOK = synchronizeCalendar( mCalendar, calendar, mode );
2818 getEventViewerDialog()->setSyncMode( false ); 2818 getEventViewerDialog()->setSyncMode( false );
2819 if ( syncOK ) { 2819 if ( syncOK ) {
2820 if ( KOPrefs::instance()->mWriteBackFile ) 2820 if ( KOPrefs::instance()->mWriteBackFile )
2821 { 2821 {
2822 storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) ); 2822 storage->setSaveFormat( new ICalFormat( KOPrefs::instance()->mUseQuicksave) );
2823 storage->save(); 2823 storage->save();
2824 } 2824 }
2825 } 2825 }
2826 setModified(); 2826 setModified();
2827 } 2827 }
2828 2828
2829#endif 2829#endif
2830} 2830}
2831 2831
2832 2832
2833//this is a overwritten callbackmethods from the syncinterface 2833//this is a overwritten callbackmethods from the syncinterface
2834bool KABCore::syncExternal(KSyncManager* manager, QString resource) 2834bool KABCore::syncExternal(KSyncManager* manager, QString resource)
2835{ 2835{
2836 QString mCurrentSyncDevice = manager->getCurrentSyncDevice(); 2836 QString mCurrentSyncDevice = manager->getCurrentSyncDevice();
2837 2837
2838 AddressBook abLocal( resource,"syncContact"); 2838 AddressBook abLocal( resource,"syncContact");
2839 bool syncOK = false; 2839 bool syncOK = false;
2840 if ( abLocal.load() ) { 2840 if ( abLocal.load() ) {
2841 qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1()); 2841 qDebug("AB sharp loaded ,sync device %s",mCurrentSyncDevice.latin1());
2842 mGlobalSyncMode = SYNC_MODE_EXTERNAL; 2842 mGlobalSyncMode = SYNC_MODE_EXTERNAL;
2843 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice ); 2843 abLocal.preExternSync( mAddressBook ,mCurrentSyncDevice );
2844 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs ); 2844 syncOK = synchronizeAddressbooks( mAddressBook, &abLocal, syncManager->mSyncAlgoPrefs );
2845 if ( syncOK ) { 2845 if ( syncOK ) {
2846 if ( syncManager->mWriteBackFile ) { 2846 if ( syncManager->mWriteBackFile ) {
2847 abLocal.saveAB(); 2847 abLocal.saveAB();
2848 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice ); 2848 abLocal.postExternSync( mAddressBook,mCurrentSyncDevice );
2849 } 2849 }
2850 } 2850 }
2851 setModified(); 2851 setModified();
2852 } 2852 }
2853 if ( syncOK ) 2853 if ( syncOK )
2854 mViewManager->refreshView(); 2854 mViewManager->refreshView();
2855 return syncOK; 2855 return syncOK;
2856 2856
2857} 2857}
2858 2858
2859void KABCore::getFile( bool success ) 2859void KABCore::getFile( bool success )
2860{ 2860{
2861 QTimer::singleShot( 15000, this , SLOT ( setCaptionBack())); 2861 QTimer::singleShot( 15000, this , SLOT ( setCaptionBack()));
2862 if ( ! success ) { 2862 if ( ! success ) {
2863 setCaption( i18n("Error receiving file. Nothing changed!") ); 2863 setCaption( i18n("Error receiving file. Nothing changed!") );
2864 return; 2864 return;
2865 } 2865 }
2866 mAddressBook->importFromFile( sentSyncFile() ); 2866 mAddressBook->importFromFile( sentSyncFile() );
2867 topLevelWidget()->setCaption( i18n("Pi-Sync successful!") ); 2867 topLevelWidget()->setCaption( i18n("Pi-Sync successful!") );
2868 mViewManager->refreshView(); 2868 mViewManager->refreshView();
2869} 2869}
2870void KABCore::syncFileRequest() 2870void KABCore::syncFileRequest()
2871{ 2871{
2872 mAddressBook->export2File( sentSyncFile() ); 2872 mAddressBook->export2File( sentSyncFile() );
2873} 2873}
2874QString KABCore::sentSyncFile() 2874QString KABCore::sentSyncFile()
2875{ 2875{
2876#ifdef _WIN32_ 2876#ifdef _WIN32_
2877 return locateLocal( "tmp", "copysyncab.vcf" ); 2877 return locateLocal( "tmp", "copysyncab.vcf" );
2878#else 2878#else
2879 return QString( "/tmp/copysyncab.vcf" ); 2879 return QString( "/tmp/copysyncab.vcf" );
2880#endif 2880#endif
2881} 2881}
2882 2882
2883void KABCore::setCaptionBack() 2883void KABCore::setCaptionBack()
2884{ 2884{
2885 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") ); 2885 topLevelWidget()->setCaption( i18n("KAddressbook/Pi") );
2886} 2886}
2887