summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 28c48fe..4d859ce 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -408,33 +408,32 @@ void KSyncManager::enableQuick( bool ask )
408 mPrefs->mPassiveSyncPort = lab.text(); 408 mPrefs->mPassiveSyncPort = lab.text();
409 changed = true; 409 changed = true;
410 } 410 }
411 autoStart = autostart.isChecked(); 411 autoStart = autostart.isChecked();
412 if (mPrefs->mPassiveSyncWithDesktop != syncdesktop.isChecked() ) { 412 if (mPrefs->mPassiveSyncWithDesktop != syncdesktop.isChecked() ) {
413 changed = true; 413 changed = true;
414 mPrefs->mPassiveSyncWithDesktop = syncdesktop.isChecked(); 414 mPrefs->mPassiveSyncWithDesktop = syncdesktop.isChecked();
415 } 415 }
416 } 416 }
417 else 417 else
418 autoStart = mPrefs->mPassiveSyncAutoStart; 418 autoStart = mPrefs->mPassiveSyncAutoStart;
419 if ( autoStart != mPrefs->mPassiveSyncAutoStart ) 419 if ( autoStart != mPrefs->mPassiveSyncAutoStart )
420 changed = true; 420 changed = true;
421 bool ok; 421 bool ok;
422 mPrefs->mPassiveSyncAutoStart = false; 422 mPrefs->mPassiveSyncAutoStart = false;
423 Q_UINT32 port_t = mPrefs->mPassiveSyncPort.toUInt(&ok); 423 Q_UINT32 port_t = mPrefs->mPassiveSyncPort.toUInt(&ok);
424 qDebug("%d ", port_t);
425 if ( ! ok || port_t > 65535 ) { 424 if ( ! ok || port_t > 65535 ) {
426 KMessageBox::information( 0, i18n("No valid port number:\n%1").arg ( mPrefs->mPassiveSyncPort ), i18n("Pi-Sync Port Error")); 425 KMessageBox::information( 0, i18n("No valid port number:\n%1").arg ( mPrefs->mPassiveSyncPort ), i18n("Pi-Sync Port Error"));
427 return; 426 return;
428 } 427 }
429 Q_UINT16 port = port_t; 428 Q_UINT16 port = port_t;
430 //qDebug("port %d ", port); 429 //qDebug("port %d ", port);
431 mServerSocket = new KServerSocket ( mPrefs->mPassiveSyncPw, port ,1 ); 430 mServerSocket = new KServerSocket ( mPrefs->mPassiveSyncPw, port ,1 );
432 mServerSocket->setFileName( defaultFileName() );//bbb 431 mServerSocket->setFileName( defaultFileName() );//bbb
433 if ( !mServerSocket->ok() ) { 432 if ( !mServerSocket->ok() ) {
434 QTimer::singleShot( 2000, this, SLOT ( displayErrorPort() ) ); 433 QTimer::singleShot( 2000, this, SLOT ( displayErrorPort() ) );
435 delete mServerSocket; 434 delete mServerSocket;
436 mServerSocket = 0; 435 mServerSocket = 0;
437 return; 436 return;
438 } 437 }
439 mPrefs->mPassiveSyncAutoStart = autoStart; 438 mPrefs->mPassiveSyncAutoStart = autoStart;
440 if ( changed ) { 439 if ( changed ) {
@@ -1299,33 +1298,33 @@ void KServerSocket::newConnection ( int socket )
1299 delete mSocket; 1298 delete mSocket;
1300 mSocket = 0; 1299 mSocket = 0;
1301 } 1300 }
1302 mPendingConnect = 0; 1301 mPendingConnect = 0;
1303 mSocket = new QSocket( this ); 1302 mSocket = new QSocket( this );
1304 connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) ); 1303 connect( mSocket , SIGNAL(readyRead()), this, SLOT(readClient()) );
1305 connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) ); 1304 connect( mSocket , SIGNAL(delayedCloseFinished()), this, SLOT(discardClient()) );
1306 mSocket->setSocket( socket ); 1305 mSocket->setSocket( socket );
1307} 1306}
1308 1307
1309void KServerSocket::discardClient() 1308void KServerSocket::discardClient()
1310{ 1309{
1311 QTimer::singleShot( 10, this , SLOT ( deleteSocket())); 1310 QTimer::singleShot( 10, this , SLOT ( deleteSocket()));
1312} 1311}
1313void KServerSocket::deleteSocket() 1312void KServerSocket::deleteSocket()
1314{ 1313{
1315 qDebug("KSS::deleteSocket"); 1314 //qDebug("KSS::deleteSocket");
1316 if ( mSocket ) { 1315 if ( mSocket ) {
1317 delete mSocket; 1316 delete mSocket;
1318 mSocket = 0; 1317 mSocket = 0;
1319 } 1318 }
1320 if ( mErrorMessage ) 1319 if ( mErrorMessage )
1321 QTimer::singleShot( 10, this , SLOT ( displayErrorMessage())); 1320 QTimer::singleShot( 10, this , SLOT ( displayErrorMessage()));
1322} 1321}
1323void KServerSocket::readClient() 1322void KServerSocket::readClient()
1324{ 1323{
1325 if ( blockRC ) 1324 if ( blockRC )
1326 return; 1325 return;
1327 if ( mSocket == 0 ) { 1326 if ( mSocket == 0 ) {
1328 qDebug("ERROR::KSS::readClient(): mSocket == 0 "); 1327 qDebug("ERROR::KSS::readClient(): mSocket == 0 ");
1329 return; 1328 return;
1330 } 1329 }
1331 if ( mErrorMessage ) { 1330 if ( mErrorMessage ) {
@@ -1587,33 +1586,33 @@ void KCommandSocket::readFile( QString fn )
1587{ 1586{
1588 if ( !mSocket ) { 1587 if ( !mSocket ) {
1589 mSocket = new QSocket( this ); 1588 mSocket = new QSocket( this );
1590 //qDebug("KCS: read file - new socket"); 1589 //qDebug("KCS: read file - new socket");
1591 connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) ); 1590 connect( mSocket, SIGNAL(readyRead()), this, SLOT(startReadFileFromSocket()) );
1592 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) ); 1591 connect( mSocket, SIGNAL(delayedCloseFinished ()), this, SLOT(deleteSocket()) );
1593 connect( mSocket, SIGNAL(connected ()), this, SLOT(sendFileRequest() )); 1592 connect( mSocket, SIGNAL(connected ()), this, SLOT(sendFileRequest() ));
1594 } 1593 }
1595 mFileString = ""; 1594 mFileString = "";
1596 mFileName = fn; 1595 mFileName = fn;
1597 mFirst = true; 1596 mFirst = true;
1598 if ( tlw ) 1597 if ( tlw )
1599 tlw->setCaption( i18n("Trying to connect to remote...") ); 1598 tlw->setCaption( i18n("Trying to connect to remote...") );
1600 mConnectCount = 30;mConnectMax = 30; 1599 mConnectCount = 30;mConnectMax = 30;
1601 mTimerSocket->start( 1000, true ); 1600 mTimerSocket->start( 1000, true );
1602 mSocket->connectToHost( mHost, mPort ); 1601 mSocket->connectToHost( mHost, mPort );
1603 qDebug("KCS: Waiting for connection"); 1602 //qDebug("KCS: Waiting for connection");
1604} 1603}
1605void KCommandSocket::updateConnectDialog() 1604void KCommandSocket::updateConnectDialog()
1606{ 1605{
1607 1606
1608 if ( mConnectCount == mConnectMax ) { 1607 if ( mConnectCount == mConnectMax ) {
1609 //qDebug("MAXX %d", mConnectMax); 1608 //qDebug("MAXX %d", mConnectMax);
1610 mConnectProgress.setTotalSteps ( 30 ); 1609 mConnectProgress.setTotalSteps ( 30 );
1611 mConnectProgress.show(); 1610 mConnectProgress.show();
1612 mConnectProgress.setLabelText( i18n("Trying to connect to remote...") ); 1611 mConnectProgress.setLabelText( i18n("Trying to connect to remote...") );
1613 } 1612 }
1614 //qDebug("updateConnectDialog() %d", mConnectCount); 1613 //qDebug("updateConnectDialog() %d", mConnectCount);
1615 mConnectProgress.raise(); 1614 mConnectProgress.raise();
1616 mConnectProgress.setProgress( (mConnectMax - mConnectCount)%30 ); 1615 mConnectProgress.setProgress( (mConnectMax - mConnectCount)%30 );
1617 --mConnectCount; 1616 --mConnectCount;
1618 if ( mConnectCount > 0 ) 1617 if ( mConnectCount > 0 )
1619 mTimerSocket->start( 1000, true ); 1618 mTimerSocket->start( 1000, true );