summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-24 02:22:48 (UTC)
committer zautrix <zautrix>2005-02-24 02:22:48 (UTC)
commit66ea8a0023a2a58e7887a41c265f2a7112b6b625 (patch) (side-by-side diff)
tree2533ce5893fc7c68e067964ad078d4b00a6e8354
parent5af16f69232073d1fa46d2dea3774beaaafb00c5 (diff)
downloadkdepimpi-66ea8a0023a2a58e7887a41c265f2a7112b6b625.zip
kdepimpi-66ea8a0023a2a58e7887a41c265f2a7112b6b625.tar.gz
kdepimpi-66ea8a0023a2a58e7887a41c265f2a7112b6b625.tar.bz2
socket fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp22
-rw-r--r--libkdepim/ksyncmanager.h2
2 files changed, 17 insertions, 7 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 47d00a4..d59f4a4 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1075,5 +1075,5 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO ||state == KCommandSocket::errorPW ||
- state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN ) {
+ state == KCommandSocket::errorCA ||state == KCommandSocket::errorFI ||state == KCommandSocket::errorUN||state == KCommandSocket::errorED ) {
if ( state == KCommandSocket::errorPW )
mParent->topLevelWidget()->setCaption( i18n("Wrong password: Receiving remote file failed.") );
@@ -1084,4 +1084,6 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state)
else if ( state == KCommandSocket::errorFI )
mParent->topLevelWidget()->setCaption( i18n("File error on remote.") );
+ else if ( state == KCommandSocket::errorED )
+ mParent->topLevelWidget()->setCaption( i18n("Please close error dialog on remote.") );
else if ( state == KCommandSocket::errorUN )
mParent->topLevelWidget()->setCaption( i18n("Unknown error on remote.") );
@@ -1184,5 +1186,5 @@ void KServerSocket::readClient()
if ( mErrorMessage ) {
mErrorMessage = 999;
- error_connect("ERROR_UN\r\n\r\n");
+ error_connect("ERROR_ED\r\n\r\n");
return;
}
@@ -1230,9 +1232,12 @@ void KServerSocket::readClient()
void KServerSocket::displayErrorMessage()
{
- if ( mErrorMessage == 1 )
+ if ( mErrorMessage == 1 ) {
KMessageBox::error( 0, i18n("Got send file request\nwith invalid password"));
- else if ( mErrorMessage == 2 )
+ mErrorMessage = 0;
+ }
+ else if ( mErrorMessage == 2 ) {
KMessageBox::error( 0, i18n("Got receive file request\nwith invalid password"));
- mErrorMessage = 0;
+ mErrorMessage = 0;
+ }
}
void KServerSocket::error_connect( QString errmess )
@@ -1266,5 +1271,5 @@ void KServerSocket::send_file()
if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
int secs = QDateTime::currentDateTime().secsTo( KSyncManager::mRequestedSyncEvent );
- secs = 333;
+ //secs = 333;
if ( secs < 0 )
secs = secs * (-1);
@@ -1522,4 +1527,9 @@ void KCommandSocket::readFileFromSocket()
return ;
}
+ if ( line.left( 8 ) == "ERROR_ED" ) {
+ mRetVal = errorED;
+ deleteSocket();
+ return ;
+ }
mRetVal = errorUN;
deleteSocket();
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index bd3ecdc..30ec1e6 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -79,5 +79,5 @@ class KCommandSocket : public QObject
Q_OBJECT
public:
- enum state { successR, errorR, successW, errorW, errorTO, errorPW, errorCA, errorFI, errorUN,quiet };
+ enum state { successR, errorR, successW, errorW, errorTO, errorPW, errorCA, errorFI, errorUN, errorED,quiet };
KCommandSocket ( QString password, Q_UINT16 port, QString host, QObject * parent=0, QWidget* cap = 0, const char * name=0 );
void readFile( QString );