summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-04 10:38:45 (UTC)
committer zautrix <zautrix>2004-10-04 10:38:45 (UTC)
commit01b5806c61deb8368f8f454fdec1c4767c73a840 (patch) (unidiff)
treef2546296a50444d02d2a74f6bf55fd57b0504ebc
parent743f44c45534a6e1df17ddc7b5f3c62b73921455 (diff)
downloadkdepimpi-01b5806c61deb8368f8f454fdec1c4767c73a840.zip
kdepimpi-01b5806c61deb8368f8f454fdec1c4767c73a840.tar.gz
kdepimpi-01b5806c61deb8368f8f454fdec1c4767c73a840.tar.bz2
sync fixes
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 8e2f956..10cb2a2 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -2116,7 +2116,7 @@ void MainWindow::performQuickQuick()
2116 os.setEncoding( QTextStream::UnicodeUTF8 ); 2116 os.setEncoding( QTextStream::UnicodeUTF8 );
2117 os << "GET " << mPassWordPiSync << "\r\n"; 2117 os << "GET " << mPassWordPiSync << "\r\n";
2118 setCaption( i18n("Sending request for remote file ...") ); 2118 setCaption( i18n("Sending request for remote file ...") );
2119 mTimerCommandSocket->start( 15000 ); 2119 mTimerCommandSocket->start( 10000 );
2120 2120
2121} 2121}
2122void MainWindow::deleteCommandSocket() 2122void MainWindow::deleteCommandSocket()
@@ -2127,6 +2127,7 @@ void MainWindow::deleteCommandSocket()
2127 KMessageBox::information( 0, i18n("ERROR:\nConnection to remote host timed out ")); 2127 KMessageBox::information( 0, i18n("ERROR:\nConnection to remote host timed out "));
2128 mTimerCommandSocket->stop(); 2128 mTimerCommandSocket->stop();
2129 } 2129 }
2130 //KMessageBox::information( 0, i18n("MainWindow::deleteCommandSocket "));
2130 qDebug("MainWindow::deletemCommandSocket() "); 2131 qDebug("MainWindow::deletemCommandSocket() ");
2131 delete mCommandSocket; 2132 delete mCommandSocket;
2132 mCommandSocket = 0; 2133 mCommandSocket = 0;
@@ -2171,7 +2172,7 @@ void MainWindow::readFileFromSocket()
2171 } 2172 }
2172 QTime ti; 2173 QTime ti;
2173 ti.start(); 2174 ti.start();
2174 while ( ti.elapsed () < 5000 && !mCommandSocket->canReadLine () ) { 2175 while ( ti.elapsed () < 3000 && !mCommandSocket->canReadLine () ) {
2175 qApp->processEvents(); 2176 qApp->processEvents();
2176 qDebug("waiting2 %d ",ti.elapsed () ); 2177 qDebug("waiting2 %d ",ti.elapsed () );
2177 if ( !mCommandSocket->canReadLine () ) 2178 if ( !mCommandSocket->canReadLine () )
@@ -2225,13 +2226,13 @@ void MainWindow::readFileFromSocket()
2225 return ; 2226 return ;
2226 2227
2227 } 2228 }
2228 setCaption( i18n("Sending back synced file...") );
2229 QTextStream ts2( &file2 ); 2229 QTextStream ts2( &file2 );
2230 ts2.setCodec( QTextCodec::codecForName("utf8") ); 2230 ts2.setCodec( QTextCodec::codecForName("utf8") );
2231 QTextStream os2( mCommandSocketFinish ); 2231 QTextStream os2( mCommandSocketFinish );
2232 os2.setCodec( QTextCodec::codecForName("utf8") ); 2232 os2.setCodec( QTextCodec::codecForName("utf8") );
2233 //os.setEncoding( QTextStream::UnicodeUTF8 ); 2233 //os.setEncoding( QTextStream::UnicodeUTF8 );
2234 if ( KOPrefs::instance()->mWriteBackFile ) { 2234 if ( KOPrefs::instance()->mWriteBackFile ) {
2235 setCaption( i18n("Sending back synced file...") );
2235 os2 << "PUT " << mPassWordPiSync << "\r\n";; 2236 os2 << "PUT " << mPassWordPiSync << "\r\n";;
2236 while ( ! ts2.atEnd() ) { 2237 while ( ! ts2.atEnd() ) {
2237 os2 << ts2.readLine() << "\n"; 2238 os2 << ts2.readLine() << "\n";
@@ -2241,11 +2242,12 @@ void MainWindow::readFileFromSocket()
2241 } 2242 }
2242 mCommandSocketFinish->close(); 2243 mCommandSocketFinish->close();
2243 if ( mCommandSocketFinish->state() == QSocket::Idle ) 2244 if ( mCommandSocketFinish->state() == QSocket::Idle )
2244 deleteCommandSocketFinish(); 2245 QTimer::singleShot( 10, this , SLOT ( deleteCommandSocketFinish()));
2245 file.close(); 2246 file.close();
2246 qDebug("Syncing succesful! "); 2247 qDebug("Syncing succesful! ");
2247 setCaption( i18n("Pi-Sync succesful!") ); 2248 setCaption( i18n("Pi-Sync succesful!") );
2248 2249
2250 // KMessageBox::information( 0, i18n(" Pi-Sync succesful! "));
2249 2251
2250} 2252}
2251 2253