-rw-r--r-- | libkdepim/ksyncmanager.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 7ee56e4..c6e06f8 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -147,5 +147,5 @@ void KSyncManager::fillSyncMenu() | |||
147 | void KSyncManager::slotSyncMenu( int action ) | 147 | void KSyncManager::slotSyncMenu( int action ) |
148 | { | 148 | { |
149 | //qDebug("syncaction %d ", action); | 149 | qDebug("syncaction %d ", action); |
150 | if ( action == 0 ) { | 150 | if ( action == 0 ) { |
151 | 151 | ||
@@ -255,4 +255,8 @@ void KSyncManager::slotSyncMenu( int action ) | |||
255 | } | 255 | } |
256 | syncPi(); | 256 | syncPi(); |
257 | while ( !mPisyncFinished ) { | ||
258 | //qDebug("waiting "); | ||
259 | qApp->processEvents(); | ||
260 | } | ||
257 | } else | 261 | } else |
258 | syncRemote( temp ); | 262 | syncRemote( temp ); |
@@ -473,5 +477,9 @@ int KSyncManager::ringSync() | |||
473 | mCurrentSyncName = mLocalMachineName; | 477 | mCurrentSyncName = mLocalMachineName; |
474 | if ( i == 0 ) { | 478 | if ( i == 0 ) { |
479 | #ifdef DESKTOP_VERSION | ||
480 | syncKDE(); | ||
481 | #else | ||
475 | syncSharp(); | 482 | syncSharp(); |
483 | #endif | ||
476 | } else { | 484 | } else { |
477 | if ( temp->getIsLocalFileSync() ) { | 485 | if ( temp->getIsLocalFileSync() ) { |
@@ -515,4 +523,12 @@ int KSyncManager::ringSync() | |||
515 | } | 523 | } |
516 | syncPi(); | 524 | syncPi(); |
525 | while ( !mPisyncFinished ) { | ||
526 | //qDebug("waiting "); | ||
527 | qApp->processEvents(); | ||
528 | } | ||
529 | timer.start(); | ||
530 | while ( timer.elapsed () < 2000 ) { | ||
531 | qApp->processEvents(); | ||
532 | } | ||
517 | } else | 533 | } else |
518 | syncRemote( temp, false ); | 534 | syncRemote( temp, false ); |
@@ -867,4 +883,5 @@ QString KSyncManager::syncFileName() | |||
867 | void KSyncManager::syncPi() | 883 | void KSyncManager::syncPi() |
868 | { | 884 | { |
885 | mPisyncFinished = false; | ||
869 | qApp->processEvents(); | 886 | qApp->processEvents(); |
870 | if ( mAskForPreferences ) | 887 | if ( mAskForPreferences ) |
@@ -893,8 +910,10 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) | |||
893 | commandSocket->sendStop(); | 910 | commandSocket->sendStop(); |
894 | } | 911 | } |
912 | mPisyncFinished = true; | ||
895 | return; | 913 | return; |
896 | 914 | ||
897 | } else if ( state == KCommandSocket::errorW ) { | 915 | } else if ( state == KCommandSocket::errorW ) { |
898 | mParent->topLevelWidget()->setCaption( i18n("ERROR:Writing back file failed.") ); | 916 | mParent->topLevelWidget()->setCaption( i18n("ERROR:Writing back file failed.") ); |
917 | mPisyncFinished = true; | ||
899 | 918 | ||
900 | } else if ( state == KCommandSocket::successR ) { | 919 | } else if ( state == KCommandSocket::successR ) { |
@@ -903,4 +922,5 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) | |||
903 | } else if ( state == KCommandSocket::successW ) { | 922 | } else if ( state == KCommandSocket::successW ) { |
904 | mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); | 923 | mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); |
924 | mPisyncFinished = true; | ||
905 | } | 925 | } |
906 | 926 | ||
@@ -914,4 +934,5 @@ void KSyncManager::readFileFromSocket() | |||
914 | if ( ! syncWithFile( fileName , true ) ) { | 934 | if ( ! syncWithFile( fileName , true ) ) { |
915 | mParent->topLevelWidget()->setCaption( i18n("Syncing failed.") ); | 935 | mParent->topLevelWidget()->setCaption( i18n("Syncing failed.") ); |
936 | mPisyncFinished = true; | ||
916 | return; | 937 | return; |
917 | } | 938 | } |
@@ -923,4 +944,5 @@ void KSyncManager::readFileFromSocket() | |||
923 | commandSocket->sendStop(); | 944 | commandSocket->sendStop(); |
924 | mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); | 945 | mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); |
946 | mPisyncFinished = true; | ||
925 | } | 947 | } |
926 | } | 948 | } |