summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index fa7804e..0109c02 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1159,49 +1159,49 @@ void KSyncManager::syncPi()
1159 mCurrentResourceRemote = mSpecificResources[ startRemote ]; 1159 mCurrentResourceRemote = mSpecificResources[ startRemote ];
1160 //qDebug ( "KSM: AAASyncing resources: Local: %s --- Remote: %s ",mCurrentResourceLocal.latin1(), mCurrentResourceRemote.latin1() ); 1160 //qDebug ( "KSM: AAASyncing resources: Local: %s --- Remote: %s ",mCurrentResourceLocal.latin1(), mCurrentResourceRemote.latin1() );
1161 if ( !mCurrentResourceRemote.isEmpty() ) { 1161 if ( !mCurrentResourceRemote.isEmpty() ) {
1162 qDebug ( "KSM: Syncing resources: Local: %s --- Remote: %s ",mCurrentResourceLocal.latin1(), mCurrentResourceRemote.latin1() ); 1162 qDebug ( "KSM: Syncing resources: Local: %s --- Remote: %s ",mCurrentResourceLocal.latin1(), mCurrentResourceRemote.latin1() );
1163 1163
1164 KCommandSocket* commandSocket = new KCommandSocket( mCurrentResourceRemote, mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() ); 1164 KCommandSocket* commandSocket = new KCommandSocket( mCurrentResourceRemote, mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() );
1165 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) ); 1165 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) );
1166 commandSocket->readFile( syncFileName() ); 1166 commandSocket->readFile( syncFileName() );
1167 mParent->topLevelWidget()->setCaption( i18n("Syncing %1 <-> %2").arg( mCurrentResourceLocal ).arg( mCurrentResourceRemote ) ); 1167 mParent->topLevelWidget()->setCaption( i18n("Syncing %1 <-> %2").arg( mCurrentResourceLocal ).arg( mCurrentResourceRemote ) );
1168 while ( !mPisyncFinished ) { 1168 while ( !mPisyncFinished ) {
1169 //qDebug("waiting "); 1169 //qDebug("waiting ");
1170 qApp->processEvents(); 1170 qApp->processEvents();
1171 } 1171 }
1172 if ( startLocal+1 < mSpecificResources.count()/2 ) { 1172 if ( startLocal+1 < mSpecificResources.count()/2 ) {
1173 mParent->topLevelWidget()->setCaption( i18n("Waiting 2 secs before syncing next resource...") ); 1173 mParent->topLevelWidget()->setCaption( i18n("Waiting 2 secs before syncing next resource...") );
1174 QTime timer; 1174 QTime timer;
1175 timer.start(); 1175 timer.start();
1176 while ( timer.elapsed () < 2000 ) { 1176 while ( timer.elapsed () < 2000 ) {
1177 qApp->processEvents(); 1177 qApp->processEvents();
1178 } 1178 }
1179 } 1179 }
1180 } 1180 }
1181 ++startRemote; 1181 ++startRemote;
1182 ++startLocal; 1182 ++startLocal;
1183 1183 mAskForPreferences = false;
1184 } 1184 }
1185 mPisyncFinished = true; 1185 mPisyncFinished = true;
1186 } else { 1186 } else {
1187 KCommandSocket* commandSocket = new KCommandSocket( "", mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() ); 1187 KCommandSocket* commandSocket = new KCommandSocket( "", mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() );
1188 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) ); 1188 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) );
1189 commandSocket->readFile( syncFileName() ); 1189 commandSocket->readFile( syncFileName() );
1190 } 1190 }
1191} 1191}
1192 1192
1193void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) 1193void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
1194{ 1194{
1195 //enum { success, errorW, errorR, quiet }; 1195 //enum { success, errorW, errorR, quiet };
1196 1196
1197 1197
1198 1198
1199 if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ||state == KCommandSocket::errorPW || 1199 if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ||state == KCommandSocket::errorPW ||
1200 state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN||state == KCommandSocket::errorED ) { 1200 state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN||state == KCommandSocket::errorED ) {
1201 if ( state == KCommandSocket::errorPW ) 1201 if ( state == KCommandSocket::errorPW )
1202 mParent->topLevelWidget()->setCaption( i18n("Wrong password: Receiving remote file failed.") ); 1202 mParent->topLevelWidget()->setCaption( i18n("Wrong password: Receiving remote file failed.") );
1203 else if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ) 1203 else if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO )
1204 mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") ); 1204 mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") );
1205 else if ( state == KCommandSocket::errorCA ) 1205 else if ( state == KCommandSocket::errorCA )
1206 mParent->topLevelWidget()->setCaption( i18n("Sync cancelled from remote.") ); 1206 mParent->topLevelWidget()->setCaption( i18n("Sync cancelled from remote.") );
1207 else if ( state == KCommandSocket::errorFI ) 1207 else if ( state == KCommandSocket::errorFI )