summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.cpp
authorzautrix <zautrix>2005-11-25 20:49:16 (UTC)
committer zautrix <zautrix>2005-11-25 20:49:16 (UTC)
commit2468bddcb380d8621d5bb49b69b3492d90562d93 (patch) (unidiff)
treec310f4fff5e476087e8406614e57a7f258f1b14f /libkdepim/ksyncmanager.cpp
parent7a439999b9fa2bd7ad76e195cdf95bf5211952cb (diff)
downloadkdepimpi-2468bddcb380d8621d5bb49b69b3492d90562d93.zip
kdepimpi-2468bddcb380d8621d5bb49b69b3492d90562d93.tar.gz
kdepimpi-2468bddcb380d8621d5bb49b69b3492d90562d93.tar.bz2
sync
Diffstat (limited to 'libkdepim/ksyncmanager.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 795cd30..d2cb71b 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1131,43 +1131,42 @@ void KSyncManager::syncPi()
1131 mPisyncFinished = true; 1131 mPisyncFinished = true;
1132 return; 1132 return;
1133 } 1133 }
1134 bool ok; 1134 bool ok;
1135 Q_UINT16 port = mActiveSyncPort.toUInt(&ok); 1135 Q_UINT16 port = mActiveSyncPort.toUInt(&ok);
1136 if ( ! ok ) { 1136 if ( ! ok ) {
1137 mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") ); 1137 mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") );
1138 mPisyncFinished = true; 1138 mPisyncFinished = true;
1139 return; 1139 return;
1140 } 1140 }
1141 mCurrentResourceLocal = ""; 1141 mCurrentResourceLocal = "";
1142 mCurrentResourceRemote = ""; 1142 mCurrentResourceRemote = "";
1143 qDebug ( "KSM: sync pi %d",mSpecificResources.count() );
1144 if ( mSpecificResources.count() ) { 1143 if ( mSpecificResources.count() ) {
1145 int lastSyncRes = mSpecificResources.count()/2; 1144 int lastSyncRes = mSpecificResources.count()/2;
1146 int ccc = mSpecificResources.count()-1; 1145 int ccc = mSpecificResources.count()-1;
1147 while ( lastSyncRes > 0 && ccc > 0 && mSpecificResources[ ccc ].isEmpty() ) { 1146 while ( lastSyncRes > 0 && ccc > 0 && mSpecificResources[ ccc ].isEmpty() ) {
1148 --ccc; 1147 --ccc;
1149 --lastSyncRes; 1148 --lastSyncRes;
1150 qDebug ( "KSM: sync pi %d",ccc ); 1149 //qDebug ( "KSM: sync pi %d",ccc );
1151 } 1150 }
1152 int startLocal = 0; 1151 int startLocal = 0;
1153 int startRemote = mSpecificResources.count()/2; 1152 int startRemote = mSpecificResources.count()/2;
1154 emit multiResourceSyncStart( true ); 1153 emit multiResourceSyncStart( true );
1155 while ( startLocal < mSpecificResources.count()/2 ) { 1154 while ( startLocal < mSpecificResources.count()/2 ) {
1156 if ( startLocal+1 >= lastSyncRes ) 1155 if ( startLocal+1 >= lastSyncRes )
1157 emit multiResourceSyncStart( false ); 1156 emit multiResourceSyncStart( false );
1158 mPisyncFinished = false; 1157 mPisyncFinished = false;
1159 mCurrentResourceLocal = mSpecificResources[ startLocal ]; 1158 mCurrentResourceLocal = mSpecificResources[ startLocal ];
1160 mCurrentResourceRemote = mSpecificResources[ startRemote ]; 1159 mCurrentResourceRemote = mSpecificResources[ startRemote ];
1161 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() );
1162 if ( !mCurrentResourceRemote.isEmpty() ) { 1161 if ( !mCurrentResourceRemote.isEmpty() ) {
1163 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() );
1164 KCommandSocket* commandSocket = new KCommandSocket( mCurrentResourceRemote, mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() ); 1163 KCommandSocket* commandSocket = new KCommandSocket( mCurrentResourceRemote, mPassWordPiSync, port, mActiveSyncIP, this, mParent->topLevelWidget() );
1165 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) ); 1164 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int )), this, SLOT(deleteCommandSocket(KCommandSocket*, int)) );
1166 commandSocket->readFile( syncFileName() ); 1165 commandSocket->readFile( syncFileName() );
1167 while ( !mPisyncFinished ) { 1166 while ( !mPisyncFinished ) {
1168 //qDebug("waiting "); 1167 //qDebug("waiting ");
1169 qApp->processEvents(); 1168 qApp->processEvents();
1170 } 1169 }
1171 } 1170 }
1172 ++startRemote; 1171 ++startRemote;
1173 ++startLocal; 1172 ++startLocal;