summaryrefslogtreecommitdiffabout
path: root/libkdepim
authorzautrix <zautrix>2005-11-25 17:41:25 (UTC)
committer zautrix <zautrix>2005-11-25 17:41:25 (UTC)
commit279e183c0325cd9565605f60af0215bb9bfdc825 (patch) (side-by-side diff)
tree43ab776cd108874819e7c6e73070a7d989a9078f /libkdepim
parent794a5204686ad9bfc16172b01db35f1f3b7683e5 (diff)
downloadkdepimpi-279e183c0325cd9565605f60af0215bb9bfdc825.zip
kdepimpi-279e183c0325cd9565605f60af0215bb9bfdc825.tar.gz
kdepimpi-279e183c0325cd9565605f60af0215bb9bfdc825.tar.bz2
sync
Diffstat (limited to 'libkdepim') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp18
-rw-r--r--libkdepim/ksyncmanager.h6
2 files changed, 21 insertions, 3 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index a64eb34..719d80b 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -198,4 +198,5 @@ void KSyncManager::slotSyncMenu( int action )
qDebug("KSM::syncaction %d ", action);
mCurrentResourceLocal = "";
+ emit multiResourceSyncStart( false );
if ( action == 5000 )
return;
@@ -442,4 +443,6 @@ void KSyncManager::enableQuick( bool ask )
connect( mServerSocket, SIGNAL ( request_file() ),this, SIGNAL ( request_file() ) );
connect( mServerSocket, SIGNAL ( file_received( bool ) ), this, SIGNAL ( getFile( bool ) ) );
+ connect( mServerSocket, SIGNAL ( request_file(const QString &) ),this, SIGNAL ( request_file(const QString &) ) );
+ connect( mServerSocket, SIGNAL ( file_received( bool ,const QString &) ), this, SIGNAL ( getFile( bool,const QString & ) ) );
}
void KSyncManager::displayErrorPort()
@@ -570,5 +573,5 @@ void KSyncManager::multiSync( bool askforPrefs )
int KSyncManager::ringSync()
{
-
+ emit multiResourceSyncStart( false );
int syncedProfiles = 0;
unsigned int i;
@@ -1141,5 +1144,8 @@ void KSyncManager::syncPi()
int startLocal = 0;
int startRemote = mSpecificResources.count()/2;
+ emit multiResourceSyncStart( true );
while ( startLocal < mSpecificResources.count()/2 ) {
+ if ( startLocal+1 >= mSpecificResources.count()/2 )
+ emit multiResourceSyncStart( false );
mPisyncFinished = false;
mCurrentResourceLocal = mSpecificResources[ startLocal ];
@@ -1220,5 +1226,5 @@ void KSyncManager::readFileFromSocket()
syncOK = false;
}
- KCommandSocket* commandSocket = new KCommandSocket( "",mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget() );
+ KCommandSocket* commandSocket = new KCommandSocket( mCurrentResourceRemote,mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget() );
connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) );
if ( mWriteBackFile && syncOK ) {
@@ -1284,4 +1290,5 @@ void KServerSocket::readClient()
return;
}
+ mResource = "";
mErrorMessage = 0;
//qDebug("KServerSocket::readClient()");
@@ -1300,4 +1307,5 @@ void KServerSocket::readClient()
else
KSyncManager::mRequestedSyncEvent = QDateTime();
+ mResource =tokens[3];
send_file();
}
@@ -1311,4 +1319,5 @@ void KServerSocket::readClient()
//emit getFile( mSocket );
blockRC = true;
+ mResource =tokens[2];
get_file();
}
@@ -1407,4 +1416,5 @@ void KServerSocket::send_file()
mSyncActionDialog->show();
mSyncActionDialog->raise();
+ emit request_file(mResource);
emit request_file();
qApp->processEvents();
@@ -1468,4 +1478,5 @@ void KServerSocket::readBackFileFromSocket()
qDebug("KSS:Error open read back file ");
piFileString = "";
+ emit file_received( false, mResource);
emit file_received( false );
blockRC = false;
@@ -1484,4 +1495,5 @@ void KServerSocket::readBackFileFromSocket()
file.close();
piFileString = "";
+ emit file_received( true, mResource );
emit file_received( true );
delete mSyncActionDialog;
@@ -1597,5 +1609,5 @@ void KCommandSocket::writeFileToSocket()
QTextStream os2( mSocket );
os2.setEncoding( QTextStream::Latin1 );
- os2 << "PUT " << mPassWord << "\r\n\r\n";;
+ os2 << "PUT " << mPassWord << mRemoteResource << "\r\n\r\n";;
int byteCount = 0;
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
void file_received( bool );
void request_file();
+ void file_received( bool, const QString &);
+ void request_file(const QString &);
void saveFile();
void endConnect();
@@ -63,4 +65,5 @@ class KServerSocket : public QServerSocket
void readBackFileFromSocket();
private :
+ QString mResource;
int mErrorMessage;
bool blockRC;
@@ -175,4 +178,7 @@ class KSyncManager : public QObject
void request_file();
void getFile( bool );
+ void getFile( bool, const QString &);
+ void request_file(const QString &);
+ void multiResourceSyncStart( bool );
public slots: