summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp12
-rw-r--r--libkdepim/ksyncmanager.h4
2 files changed, 12 insertions, 4 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 28af135..fad9a76 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -788,10 +788,12 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
//enum { success, errorW, errorR, quiet };
- if ( state == KCommandSocket::errorR ) {
+ if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ) {
mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") );
delete s;
+ if ( state == KCommandSocket::errorR ) {
KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this );
connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) );
commandSocket->sendStop();
+ }
return;
@@ -1138,5 +1140,11 @@ void KCommandSocket::deleteSocket()
mTimerSocket->stop();
KMessageBox::information( 0, i18n("ERROR:\nConnection to remote host timed out!\nDid you forgot to enable\nsyncing on remote host? "));
- mRetVal = errorR;
+ mRetVal = errorTO;
+ if ( mSocket ) {
+ mSocket->close();
+ if ( mSocket->state() == QSocket::Idle )
+ deleteSocket();
+ return;
+ }
}
//qDebug("KCommandSocket::deleteSocket() %d", mRetVal );
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 32400af..25892d8 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -76,5 +76,5 @@ class KCommandSocket : public QObject
Q_OBJECT
public:
- enum state { successR, errorR, successW, errorW, quiet };
+ enum state { successR, errorR, successW, errorW, errorTO, quiet };
KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, const char * name=0 );
void readFile( QString );
@@ -123,4 +123,5 @@ class KSyncManager : public QObject
QString defaultFileName() { return mDefFileName ;}
QString syncFileName();
+ void fillSyncMenu();
QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
@@ -158,5 +159,4 @@ class KSyncManager : public QObject
public slots:
- void fillSyncMenu();
void slotSyncMenu( int );
void deleteCommandSocket(KCommandSocket*s, int state);