summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (show 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
@@ -787,12 +787,14 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
787 qDebug("MainWindow::deleteCommandSocket %d", state); 787 qDebug("MainWindow::deleteCommandSocket %d", state);
788 788
789 //enum { success, errorW, errorR, quiet }; 789 //enum { success, errorW, errorR, quiet };
790 if ( state == KCommandSocket::errorR ) { 790 if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ) {
791 mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") ); 791 mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") );
792 delete s; 792 delete s;
793 if ( state == KCommandSocket::errorR ) {
793 KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this ); 794 KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this );
794 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); 795 connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) );
795 commandSocket->sendStop(); 796 commandSocket->sendStop();
797 }
796 return; 798 return;
797 799
798 } else if ( state == KCommandSocket::errorW ) { 800 } else if ( state == KCommandSocket::errorW ) {
@@ -1137,7 +1139,13 @@ void KCommandSocket::deleteSocket()
1137 if ( mTimerSocket->isActive () ) { 1139 if ( mTimerSocket->isActive () ) {
1138 mTimerSocket->stop(); 1140 mTimerSocket->stop();
1139 KMessageBox::information( 0, i18n("ERROR:\nConnection to remote host timed out!\nDid you forgot to enable\nsyncing on remote host? ")); 1141 KMessageBox::information( 0, i18n("ERROR:\nConnection to remote host timed out!\nDid you forgot to enable\nsyncing on remote host? "));
1140 mRetVal = errorR; 1142 mRetVal = errorTO;
1143 if ( mSocket ) {
1144 mSocket->close();
1145 if ( mSocket->state() == QSocket::Idle )
1146 deleteSocket();
1147 return;
1148 }
1141 } 1149 }
1142 //qDebug("KCommandSocket::deleteSocket() %d", mRetVal ); 1150 //qDebug("KCommandSocket::deleteSocket() %d", mRetVal );
1143 if ( mSocket) 1151 if ( mSocket)
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index 32400af..25892d8 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -75,7 +75,7 @@ class KCommandSocket : public QObject
75{ 75{
76 Q_OBJECT 76 Q_OBJECT
77public: 77public:
78 enum state { successR, errorR, successW, errorW, quiet }; 78 enum state { successR, errorR, successW, errorW, errorTO, quiet };
79 KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, const char * name=0 ); 79 KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, const char * name=0 );
80 void readFile( QString ); 80 void readFile( QString );
81 void writeFile( QString ); 81 void writeFile( QString );
@@ -122,6 +122,7 @@ class KSyncManager : public QObject
122 void setDefaultFileName( QString s) { mDefFileName = s ;} 122 void setDefaultFileName( QString s) { mDefFileName = s ;}
123 QString defaultFileName() { return mDefFileName ;} 123 QString defaultFileName() { return mDefFileName ;}
124 QString syncFileName(); 124 QString syncFileName();
125 void fillSyncMenu();
125 126
126 QString getCurrentSyncDevice() { return mCurrentSyncDevice; } 127 QString getCurrentSyncDevice() { return mCurrentSyncDevice; }
127 QString getCurrentSyncName() { return mCurrentSyncName; } 128 QString getCurrentSyncName() { return mCurrentSyncName; }
@@ -157,7 +158,6 @@ class KSyncManager : public QObject
157 void getFile( bool ); 158 void getFile( bool );
158 159
159 public slots: 160 public slots:
160 void fillSyncMenu();
161 void slotSyncMenu( int ); 161 void slotSyncMenu( int );
162 void deleteCommandSocket(KCommandSocket*s, int state); 162 void deleteCommandSocket(KCommandSocket*s, int state);
163 void readFileFromSocket(); 163 void readFileFromSocket();