summaryrefslogtreecommitdiffabout
path: root/libkdepim/ksyncmanager.cpp
Unidiff
Diffstat (limited to 'libkdepim/ksyncmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 7c53948..6f68d84 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1323,49 +1323,49 @@ KCommandSocket::KCommandSocket ( QString password, Q_UINT16 port, QString host,
1323 mSocket = 0; 1323 mSocket = 0;
1324 mPort = port; 1324 mPort = port;
1325 mHost = host; 1325 mHost = host;
1326 1326
1327 mRetVal = quiet; 1327 mRetVal = quiet;
1328 mTimerSocket = new QTimer ( this ); 1328 mTimerSocket = new QTimer ( this );
1329 connect( mTimerSocket, SIGNAL ( timeout () ), this, SLOT ( deleteSocket() ) ); 1329 connect( mTimerSocket, SIGNAL ( timeout () ), this, SLOT ( deleteSocket() ) );
1330} 1330}
1331void KCommandSocket::readFile( QString fn ) 1331void KCommandSocket::readFile( QString fn )
1332{ 1332{
1333 if ( !mSocket ) { 1333 if ( !mSocket ) {
1334 mSocket = new QSocket( this ); 1334 mSocket = new QSocket( this );
1335 connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) ); 1335 connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) );
1336 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1336 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1337 } 1337 }
1338 mFileString = ""; 1338 mFileString = "";
1339 mFileName = fn; 1339 mFileName = fn;
1340 mFirst = true; 1340 mFirst = true;
1341 mSocket->connectToHost( mHost, mPort ); 1341 mSocket->connectToHost( mHost, mPort );
1342 QTextStream os( mSocket ); 1342 QTextStream os( mSocket );
1343 os.setEncoding( QTextStream::Latin1 ); 1343 os.setEncoding( QTextStream::Latin1 );
1344 1344
1345 QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate ); 1345 QString curDt = " " +KGlobal::locale()->formatDateTime(QDateTime::currentDateTime().addSecs(-1),true, true,KLocale::ISODate );
1346 os << "GET " << mPassWord << curDt <<"\r\n"; 1346 os << "GET " << mPassWord << curDt <<"\r\n";
1347 mTimerSocket->start( 20000 ); 1347 mTimerSocket->start( 300000 );
1348} 1348}
1349 1349
1350void KCommandSocket::writeFile( QString fileName ) 1350void KCommandSocket::writeFile( QString fileName )
1351{ 1351{
1352 if ( !mSocket ) { 1352 if ( !mSocket ) {
1353 mSocket = new QSocket( this ); 1353 mSocket = new QSocket( this );
1354 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1354 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1355 connect( mSocket, SIGNAL(connected ()), this, SLOT(writeFileToSocket()) ); 1355 connect( mSocket, SIGNAL(connected ()), this, SLOT(writeFileToSocket()) );
1356 } 1356 }
1357 mFileName = fileName ; 1357 mFileName = fileName ;
1358 mSocket->connectToHost( mHost, mPort ); 1358 mSocket->connectToHost( mHost, mPort );
1359} 1359}
1360void KCommandSocket::writeFileToSocket() 1360void KCommandSocket::writeFileToSocket()
1361{ 1361{
1362 QFile file2( mFileName ); 1362 QFile file2( mFileName );
1363 if (!file2.open( IO_ReadOnly ) ) { 1363 if (!file2.open( IO_ReadOnly ) ) {
1364 mRetVal= errorW; 1364 mRetVal= errorW;
1365 mSocket->close(); 1365 mSocket->close();
1366 if ( mSocket->state() == QSocket::Idle ) 1366 if ( mSocket->state() == QSocket::Idle )
1367 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1367 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1368 return ; 1368 return ;
1369 } 1369 }
1370 QTextStream ts2( &file2 ); 1370 QTextStream ts2( &file2 );
1371 ts2.setEncoding( QTextStream::Latin1 ); 1371 ts2.setEncoding( QTextStream::Latin1 );