summaryrefslogtreecommitdiffabout
path: root/korganizer/mainwindow.cpp
Unidiff
Diffstat (limited to 'korganizer/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index d8aa43a..aa30b52 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -893,48 +893,51 @@ void MainWindow::fillSyncMenu()
893 syncMenu->setItemEnabled( false , 1000 ); 893 syncMenu->setItemEnabled( false , 1000 );
894 } 894 }
895 mView->setupExternSyncProfiles(); 895 mView->setupExternSyncProfiles();
896} 896}
897 897
898int MainWindow::ringSync() 898int MainWindow::ringSync()
899{ 899{
900 int syncedProfiles = 0; 900 int syncedProfiles = 0;
901 int i; 901 int i;
902 QTime timer; 902 QTime timer;
903 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 903 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
904 QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames; 904 QStringList syncProfileNames = KOPrefs::instance()->mSyncProfileNames;
905 KSyncProfile* temp = new KSyncProfile (); 905 KSyncProfile* temp = new KSyncProfile ();
906 KOPrefs::instance()->mAskForPreferences = false; 906 KOPrefs::instance()->mAskForPreferences = false;
907 for ( i = 0; i < syncProfileNames.count(); ++i ) { 907 for ( i = 0; i < syncProfileNames.count(); ++i ) {
908 mCurrentSyncProfile = i; 908 mCurrentSyncProfile = i;
909 temp->setName(syncProfileNames[mCurrentSyncProfile]); 909 temp->setName(syncProfileNames[mCurrentSyncProfile]);
910 temp->readConfig(&config); 910 temp->readConfig(&config);
911 if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) { 911 if ( temp->getIncludeInRingSync() && ( i < 1 || i > 2 )) {
912 setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... ")); 912 setCaption(i18n("Profile ")+syncProfileNames[mCurrentSyncProfile]+ i18n(" is synced ... "));
913 ++syncedProfiles; 913 ++syncedProfiles;
914 // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); 914 // KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences();
915 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); 915 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile();
916 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); 916 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting();
917 KOPrefs::instance()->mWriteBackInFuture = 0;
918 if ( temp->getWriteBackFuture() )
919 KOPrefs::instance()->mWriteBackInFuture = temp->getWriteBackFutureWeeks( );
917 KOPrefs::instance()->mShowSyncSummary = false; 920 KOPrefs::instance()->mShowSyncSummary = false;
918 mView->setSyncDevice(syncProfileNames[i] ); 921 mView->setSyncDevice(syncProfileNames[i] );
919 mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); 922 mView->setSyncName( KOPrefs::instance()->mLocalMachineName );
920 if ( i == 0 ) { 923 if ( i == 0 ) {
921 syncSharp(); 924 syncSharp();
922 } else { 925 } else {
923 if ( temp->getIsLocalFileSync() ) { 926 if ( temp->getIsLocalFileSync() ) {
924 if ( syncWithFile( temp->getRemoteFileName( ), true ) ) 927 if ( syncWithFile( temp->getRemoteFileName( ), true ) )
925 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); 928 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName();
926 } else { 929 } else {
927 if ( temp->getIsPhoneSync() ) { 930 if ( temp->getIsPhoneSync() ) {
928 KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; 931 KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ;
929 KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); 932 KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( );
930 KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); 933 KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( );
931 syncPhone(); 934 syncPhone();
932 } else 935 } else
933 syncRemote( temp, false ); 936 syncRemote( temp, false );
934 937
935 } 938 }
936 } 939 }
937 timer.start(); 940 timer.start();
938 setCaption(i18n("Multiple sync in progress ... please wait!") ); 941 setCaption(i18n("Multiple sync in progress ... please wait!") );
939 while ( timer.elapsed () < 2000 ) { 942 while ( timer.elapsed () < 2000 ) {
940 qApp->processEvents(); 943 qApp->processEvents();
@@ -996,48 +999,51 @@ void MainWindow::slotSyncMenu( int action )
996 QTimer::singleShot ( 1, this, SLOT ( confSync() ) ); 999 QTimer::singleShot ( 1, this, SLOT ( confSync() ) );
997 //confSync(); 1000 //confSync();
998 1001
999 return; 1002 return;
1000 } 1003 }
1001 if ( action == 1 ) { 1004 if ( action == 1 ) {
1002 multiSync( true ); 1005 multiSync( true );
1003 return; 1006 return;
1004 } 1007 }
1005 1008
1006 if (mBlockSaveFlag) 1009 if (mBlockSaveFlag)
1007 return; 1010 return;
1008 mBlockSaveFlag = true; 1011 mBlockSaveFlag = true;
1009 mCurrentSyncProfile = action - 1000 ; 1012 mCurrentSyncProfile = action - 1000 ;
1010 mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] ); 1013 mView->setSyncDevice(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile] );
1011 mView->setSyncName( KOPrefs::instance()->mLocalMachineName ); 1014 mView->setSyncName( KOPrefs::instance()->mLocalMachineName );
1012 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) ); 1015 KConfig config ( locateLocal( "config","ksyncprofilesrc" ) );
1013 KSyncProfile* temp = new KSyncProfile (); 1016 KSyncProfile* temp = new KSyncProfile ();
1014 temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]); 1017 temp->setName(KOPrefs::instance()->mSyncProfileNames[mCurrentSyncProfile]);
1015 temp->readConfig(&config); 1018 temp->readConfig(&config);
1016 KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences(); 1019 KOPrefs::instance()->mAskForPreferences = temp->getAskForPreferences();
1017 KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs(); 1020 KOPrefs::instance()->mSyncAlgoPrefs = temp->getSyncPrefs();
1018 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile(); 1021 KOPrefs::instance()->mWriteBackFile = temp->getWriteBackFile();
1019 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting(); 1022 KOPrefs::instance()->mWriteBackExistingOnly = temp->getWriteBackExisting();
1023 KOPrefs::instance()->mWriteBackInFuture = 0;
1024 if ( temp->getWriteBackFuture() )
1025 KOPrefs::instance()->mWriteBackInFuture = temp->getWriteBackFutureWeeks( );
1020 KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync(); 1026 KOPrefs::instance()->mShowSyncSummary = temp->getShowSummaryAfterSync();
1021 if ( action == 1000 ) { 1027 if ( action == 1000 ) {
1022 syncSharp(); 1028 syncSharp();
1023 1029
1024 } else if ( action == 1001 ) { 1030 } else if ( action == 1001 ) {
1025 syncLocalFile(); 1031 syncLocalFile();
1026 1032
1027 } else if ( action == 1002 ) { 1033 } else if ( action == 1002 ) {
1028 quickSyncLocalFile(); 1034 quickSyncLocalFile();
1029 1035
1030 } else if ( action >= 1003 ) { 1036 } else if ( action >= 1003 ) {
1031 if ( temp->getIsLocalFileSync() ) { 1037 if ( temp->getIsLocalFileSync() ) {
1032 if ( syncWithFile( temp->getRemoteFileName( ), false ) ) 1038 if ( syncWithFile( temp->getRemoteFileName( ), false ) )
1033 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName(); 1039 KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName();
1034 } else { 1040 } else {
1035 if ( temp->getIsPhoneSync() ) { 1041 if ( temp->getIsPhoneSync() ) {
1036 KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ; 1042 KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ;
1037 KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( ); 1043 KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( );
1038 KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( ); 1044 KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( );
1039 syncPhone(); 1045 syncPhone();
1040 } else 1046 } else
1041 syncRemote( temp ); 1047 syncRemote( temp );
1042 1048
1043 } 1049 }