summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-22 03:43:50 (UTC)
committer zautrix <zautrix>2005-02-22 03:43:50 (UTC)
commit26f4ba7e3cc59ff5c5b9b8705179626e2752451b (patch) (side-by-side diff)
tree2fd2b8ef6c9b80b4408fd885577d0dbc764dc35f
parent2097bbebc5e90e6469c24023e7796ada1762e9ed (diff)
downloadkdepimpi-26f4ba7e3cc59ff5c5b9b8705179626e2752451b.zip
kdepimpi-26f4ba7e3cc59ff5c5b9b8705179626e2752451b.tar.gz
kdepimpi-26f4ba7e3cc59ff5c5b9b8705179626e2752451b.tar.bz2
pi-sync fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 02e5587..08a263c 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1053,4 +1053,5 @@ void KSyncManager::syncPi()
if ( !edit_pisync_options()) {
mParent->topLevelWidget()->setCaption( i18n("Syncing aborted. Nothing synced.") );
+ mPisyncFinished = true;
return;
}
@@ -1059,4 +1060,5 @@ void KSyncManager::syncPi()
if ( ! ok ) {
mParent->topLevelWidget()->setCaption( i18n("Sorry, no valid port.Syncing cancelled.") );
+ mPisyncFinished = true;
return;
}
@@ -1090,4 +1092,10 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
mParent->topLevelWidget()->setCaption( i18n("Pi-Sync successful!") );
mPisyncFinished = true;
+ } else if ( state == KCommandSocket::quiet ){
+ qDebug("KSS: quiet ");
+ mPisyncFinished = true;
+ } else {
+ qDebug("KSS: Error: unknown state: %d ", state);
+ mPisyncFinished = true;
}
@@ -1272,6 +1280,7 @@ void KServerSocket::send_file()
os.setEncoding( QTextStream::Latin1 );
while ( ! ts.atEnd() ) {
- os << ts.readLine() << "\r\n\r\n";
+ os << ts.readLine() << "\r\n";
}
+ os << "\r\n";
//os << ts.read();
file.close();
@@ -1375,7 +1384,7 @@ void KCommandSocket::readFile( QString fn )
if ( tlw )
tlw->setCaption( i18n("Trying to connect to remote...") );
+ mTimerSocket->start( 20000 );
mSocket->connectToHost( mHost, mPort );
qDebug("KSS: Waiting for connection");
- mTimerSocket->start( 20000 );
}
@@ -1388,8 +1397,10 @@ void KCommandSocket::writeFile( QString fileName )
}
mFileName = fileName ;
+ mTimerSocket->start( 20000 );
mSocket->connectToHost( mHost, mPort );
}
void KCommandSocket::writeFileToSocket()
{
+ mTimerSocket->stop();
QFile file2( mFileName );
if (!file2.open( IO_ReadOnly ) ) {
@@ -1406,6 +1417,7 @@ void KCommandSocket::writeFileToSocket()
os2 << "PUT " << mPassWord << "\r\n\r\n";;
while ( ! ts2.atEnd() ) {
- os2 << ts2.readLine() << "\r\n\r\n";
+ os2 << ts2.readLine() << "\r\n";
}
+ os2 << "\r\n";
mRetVal= successW;
file2.close();