author | zautrix <zautrix> | 2004-10-17 01:11:53 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-17 01:11:53 (UTC) |
commit | f909868a098a22c17906f3d2ab05d5fac0332e85 (patch) (side-by-side diff) | |
tree | 6b52827f6047c25a2ef3d88304c01f74b68f24cb /libkdepim | |
parent | 9f0a9fb68e70c53593f9cd8340a8bb16d7f6833f (diff) | |
download | kdepimpi-f909868a098a22c17906f3d2ab05d5fac0332e85.zip kdepimpi-f909868a098a22c17906f3d2ab05d5fac0332e85.tar.gz kdepimpi-f909868a098a22c17906f3d2ab05d5fac0332e85.tar.bz2 |
many sync fixes
-rw-r--r-- | libkdepim/ksyncmanager.cpp | 24 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 9 |
2 files changed, 28 insertions, 5 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() void KSyncManager::slotSyncMenu( int action ) { - //qDebug("syncaction %d ", action); + qDebug("syncaction %d ", action); if ( action == 0 ) { @@ -255,4 +255,8 @@ void KSyncManager::slotSyncMenu( int action ) } syncPi(); + while ( !mPisyncFinished ) { + //qDebug("waiting "); + qApp->processEvents(); + } } else syncRemote( temp ); @@ -473,5 +477,9 @@ int KSyncManager::ringSync() mCurrentSyncName = mLocalMachineName; if ( i == 0 ) { +#ifdef DESKTOP_VERSION + syncKDE(); +#else syncSharp(); +#endif } else { if ( temp->getIsLocalFileSync() ) { @@ -515,4 +523,12 @@ int KSyncManager::ringSync() } syncPi(); + while ( !mPisyncFinished ) { + //qDebug("waiting "); + qApp->processEvents(); + } + timer.start(); + while ( timer.elapsed () < 2000 ) { + qApp->processEvents(); + } } else syncRemote( temp, false ); @@ -867,4 +883,5 @@ QString KSyncManager::syncFileName() void KSyncManager::syncPi() { + mPisyncFinished = false; qApp->processEvents(); if ( mAskForPreferences ) @@ -893,8 +910,10 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) commandSocket->sendStop(); } + mPisyncFinished = true; return; } else if ( state == KCommandSocket::errorW ) { mParent->topLevelWidget()->setCaption( i18n("ERROR:Writing back file failed.") ); + mPisyncFinished = true; } else if ( state == KCommandSocket::successR ) { @@ -903,4 +922,5 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) } else if ( state == KCommandSocket::successW ) { mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); + mPisyncFinished = true; } @@ -914,4 +934,5 @@ void KSyncManager::readFileFromSocket() if ( ! syncWithFile( fileName , true ) ) { mParent->topLevelWidget()->setCaption( i18n("Syncing failed.") ); + mPisyncFinished = true; return; } @@ -923,4 +944,5 @@ void KSyncManager::readFileFromSocket() commandSocket->sendStop(); mParent->topLevelWidget()->setCaption( i18n("Pi-Sync succesful!") ); + mPisyncFinished = true; } } diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index 7d5b05e..ffb1ea4 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h @@ -179,8 +179,5 @@ class KSyncManager : public QObject int ringSync(); QString getPassword( ); - - private slots: - void confSync(); - private: + bool mPisyncFinished; bool mBlockSaveFlag; QWidget* mParent; @@ -190,4 +187,8 @@ class KSyncManager : public QObject QProgressBar* bar; +private slots: + void confSync(); + + }; |