-rw-r--r-- | libkdepim/ksyncmanager.cpp | 24 | ||||
-rw-r--r-- | libkdepim/ksyncmanager.h | 6 |
2 files changed, 24 insertions, 6 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index a64eb34..719d80b 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp | |||
@@ -197,5 +197,6 @@ void KSyncManager::slotSyncMenu( int action ) | |||
197 | { | 197 | { |
198 | qDebug("KSM::syncaction %d ", action); | 198 | qDebug("KSM::syncaction %d ", action); |
199 | mCurrentResourceLocal = ""; | 199 | mCurrentResourceLocal = ""; |
200 | emit multiResourceSyncStart( false ); | ||
200 | if ( action == 5000 ) | 201 | if ( action == 5000 ) |
201 | return; | 202 | return; |
@@ -442,4 +443,6 @@ void KSyncManager::enableQuick( bool ask ) | |||
442 | connect( mServerSocket, SIGNAL ( request_file() ),this, SIGNAL ( request_file() ) ); | 443 | connect( mServerSocket, SIGNAL ( request_file() ),this, SIGNAL ( request_file() ) ); |
443 | connect( mServerSocket, SIGNAL ( file_received( bool ) ), this, SIGNAL ( getFile( bool ) ) ); | 444 | connect( mServerSocket, SIGNAL ( file_received( bool ) ), this, SIGNAL ( getFile( bool ) ) ); |
445 | connect( mServerSocket, SIGNAL ( request_file(const QString &) ),this, SIGNAL ( request_file(const QString &) ) ); | ||
446 | connect( mServerSocket, SIGNAL ( file_received( bool ,const QString &) ), this, SIGNAL ( getFile( bool,const QString & ) ) ); | ||
444 | } | 447 | } |
445 | void KSyncManager::displayErrorPort() | 448 | void KSyncManager::displayErrorPort() |
@@ -570,5 +573,5 @@ void KSyncManager::multiSync( bool askforPrefs ) | |||
570 | int KSyncManager::ringSync() | 573 | int KSyncManager::ringSync() |
571 | { | 574 | { |
572 | 575 | emit multiResourceSyncStart( false ); | |
573 | int syncedProfiles = 0; | 576 | int syncedProfiles = 0; |
574 | unsigned int i; | 577 | unsigned int i; |
@@ -1141,5 +1144,8 @@ void KSyncManager::syncPi() | |||
1141 | int startLocal = 0; | 1144 | int startLocal = 0; |
1142 | int startRemote = mSpecificResources.count()/2; | 1145 | int startRemote = mSpecificResources.count()/2; |
1146 | emit multiResourceSyncStart( true ); | ||
1143 | while ( startLocal < mSpecificResources.count()/2 ) { | 1147 | while ( startLocal < mSpecificResources.count()/2 ) { |
1148 | if ( startLocal+1 >= mSpecificResources.count()/2 ) | ||
1149 | emit multiResourceSyncStart( false ); | ||
1144 | mPisyncFinished = false; | 1150 | mPisyncFinished = false; |
1145 | mCurrentResourceLocal = mSpecificResources[ startLocal ]; | 1151 | mCurrentResourceLocal = mSpecificResources[ startLocal ]; |
@@ -1220,5 +1226,5 @@ void KSyncManager::readFileFromSocket() | |||
1220 | syncOK = false; | 1226 | syncOK = false; |
1221 | } | 1227 | } |
1222 | KCommandSocket* commandSocket = new KCommandSocket( "",mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget() ); | 1228 | KCommandSocket* commandSocket = new KCommandSocket( mCurrentResourceRemote,mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget() ); |
1223 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); | 1229 | connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); |
1224 | if ( mWriteBackFile && syncOK ) { | 1230 | if ( mWriteBackFile && syncOK ) { |
@@ -1284,4 +1290,5 @@ void KServerSocket::readClient() | |||
1284 | return; | 1290 | return; |
1285 | } | 1291 | } |
1292 | mResource = ""; | ||
1286 | mErrorMessage = 0; | 1293 | mErrorMessage = 0; |
1287 | //qDebug("KServerSocket::readClient()"); | 1294 | //qDebug("KServerSocket::readClient()"); |
@@ -1300,4 +1307,5 @@ void KServerSocket::readClient() | |||
1300 | else | 1307 | else |
1301 | KSyncManager::mRequestedSyncEvent = QDateTime(); | 1308 | KSyncManager::mRequestedSyncEvent = QDateTime(); |
1309 | mResource =tokens[3]; | ||
1302 | send_file(); | 1310 | send_file(); |
1303 | } | 1311 | } |
@@ -1311,4 +1319,5 @@ void KServerSocket::readClient() | |||
1311 | //emit getFile( mSocket ); | 1319 | //emit getFile( mSocket ); |
1312 | blockRC = true; | 1320 | blockRC = true; |
1321 | mResource =tokens[2]; | ||
1313 | get_file(); | 1322 | get_file(); |
1314 | } | 1323 | } |
@@ -1407,4 +1416,5 @@ void KServerSocket::send_file() | |||
1407 | mSyncActionDialog->show(); | 1416 | mSyncActionDialog->show(); |
1408 | mSyncActionDialog->raise(); | 1417 | mSyncActionDialog->raise(); |
1418 | emit request_file(mResource); | ||
1409 | emit request_file(); | 1419 | emit request_file(); |
1410 | qApp->processEvents(); | 1420 | qApp->processEvents(); |
@@ -1468,5 +1478,6 @@ void KServerSocket::readBackFileFromSocket() | |||
1468 | qDebug("KSS:Error open read back file "); | 1478 | qDebug("KSS:Error open read back file "); |
1469 | piFileString = ""; | 1479 | piFileString = ""; |
1470 | emit file_received( false ); | 1480 | emit file_received( false, mResource); |
1481 | emit file_received( false); | ||
1471 | blockRC = false; | 1482 | blockRC = false; |
1472 | return ; | 1483 | return ; |
@@ -1484,5 +1495,6 @@ void KServerSocket::readBackFileFromSocket() | |||
1484 | file.close(); | 1495 | file.close(); |
1485 | piFileString = ""; | 1496 | piFileString = ""; |
1486 | emit file_received( true ); | 1497 | emit file_received( true, mResource ); |
1498 | emit file_received( true); | ||
1487 | delete mSyncActionDialog; | 1499 | delete mSyncActionDialog; |
1488 | mSyncActionDialog = 0; | 1500 | mSyncActionDialog = 0; |
@@ -1597,5 +1609,5 @@ void KCommandSocket::writeFileToSocket() | |||
1597 | QTextStream os2( mSocket ); | 1609 | QTextStream os2( mSocket ); |
1598 | os2.setEncoding( QTextStream::Latin1 ); | 1610 | os2.setEncoding( QTextStream::Latin1 ); |
1599 | os2 << "PUT " << mPassWord << "\r\n\r\n";; | 1611 | os2 << "PUT " << mPassWord << mRemoteResource << "\r\n\r\n";; |
1600 | int byteCount = 0; | 1612 | int byteCount = 0; |
1601 | int byteMax = file2.size()/53; | 1613 | int byteMax = file2.size()/53; |
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h index f4654ce..53c611d 100644 --- a/libkdepim/ksyncmanager.h +++ b/libkdepim/ksyncmanager.h | |||
@@ -54,4 +54,6 @@ class KServerSocket : public QServerSocket | |||
54 | void file_received( bool ); | 54 | void file_received( bool ); |
55 | void request_file(); | 55 | void request_file(); |
56 | void file_received( bool, const QString &); | ||
57 | void request_file(const QString &); | ||
56 | void saveFile(); | 58 | void saveFile(); |
57 | void endConnect(); | 59 | void endConnect(); |
@@ -63,4 +65,5 @@ class KServerSocket : public QServerSocket | |||
63 | void readBackFileFromSocket(); | 65 | void readBackFileFromSocket(); |
64 | private : | 66 | private : |
67 | QString mResource; | ||
65 | int mErrorMessage; | 68 | int mErrorMessage; |
66 | bool blockRC; | 69 | bool blockRC; |
@@ -175,4 +178,7 @@ class KSyncManager : public QObject | |||
175 | void request_file(); | 178 | void request_file(); |
176 | void getFile( bool ); | 179 | void getFile( bool ); |
180 | void getFile( bool, const QString &); | ||
181 | void request_file(const QString &); | ||
182 | void multiResourceSyncStart( bool ); | ||
177 | 183 | ||
178 | public slots: | 184 | public slots: |