-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 @@ -148,3 +148,3 @@ void KSyncManager::slotSyncMenu( int action ) { - //qDebug("syncaction %d ", action); + qDebug("syncaction %d ", action); if ( action == 0 ) { @@ -256,2 +256,6 @@ void KSyncManager::slotSyncMenu( int action ) syncPi(); + while ( !mPisyncFinished ) { + //qDebug("waiting "); + qApp->processEvents(); + } } else @@ -474,3 +478,7 @@ int KSyncManager::ringSync() if ( i == 0 ) { +#ifdef DESKTOP_VERSION + syncKDE(); +#else syncSharp(); +#endif } else { @@ -516,2 +524,10 @@ int KSyncManager::ringSync() syncPi(); + while ( !mPisyncFinished ) { + //qDebug("waiting "); + qApp->processEvents(); + } + timer.start(); + while ( timer.elapsed () < 2000 ) { + qApp->processEvents(); + } } else @@ -868,2 +884,3 @@ void KSyncManager::syncPi() { + mPisyncFinished = false; qApp->processEvents(); @@ -894,2 +911,3 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) } + mPisyncFinished = true; return; @@ -898,2 +916,3 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) mParent->topLevelWidget()->setCaption( i18n("ERROR:Writing back file failed.") ); + mPisyncFinished = true; @@ -904,2 +923,3 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); + mPisyncFinished = true; } @@ -915,2 +935,3 @@ void KSyncManager::readFileFromSocket() mParent->topLevelWidget()->setCaption( i18n("Syncing failed.") ); + mPisyncFinished = true; return; @@ -924,2 +945,3 @@ void KSyncManager::readFileFromSocket() mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); + mPisyncFinished = true; } |