summaryrefslogtreecommitdiffabout
path: root/libkdepim
Side-by-side diff
Diffstat (limited to 'libkdepim') (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp20
-rw-r--r--libkdepim/ksyncmanager.h2
2 files changed, 16 insertions, 6 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 47d00a4..d59f4a4 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -1073,17 +1073,19 @@ 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.") );
else if ( state == KCommandSocket::errorR ||state == KCommandSocket::errorTO )
mParent->topLevelWidget()->setCaption( i18n("ERROR: Receiving remote file failed.") );
else if ( state == KCommandSocket::errorCA )
mParent->topLevelWidget()->setCaption( i18n("Sync cancelled from remote.") );
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.") );
delete s;
if ( state == KCommandSocket::errorR ) {
@@ -1182,9 +1184,9 @@ void KServerSocket::readClient()
return;
}
if ( mErrorMessage ) {
mErrorMessage = 999;
- error_connect("ERROR_UN\r\n\r\n");
+ error_connect("ERROR_ED\r\n\r\n");
return;
}
mErrorMessage = 0;
//qDebug("KServerSocket::readClient()");
@@ -1228,14 +1230,17 @@ 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;
}
+}
void KServerSocket::error_connect( QString errmess )
{
QTextStream os( mSocket );
os.setEncoding( QTextStream::Latin1 );
@@ -1264,9 +1269,9 @@ void KServerSocket::send_file()
lay->setMargin(7);
lay->setSpacing(7);
if ( KSyncManager::mRequestedSyncEvent.isValid() ) {
int secs = QDateTime::currentDateTime().secsTo( KSyncManager::mRequestedSyncEvent );
- secs = 333;
+ //secs = 333;
if ( secs < 0 )
secs = secs * (-1);
if ( secs > 30 )
//if ( true )
@@ -1520,8 +1525,13 @@ void KCommandSocket::readFileFromSocket()
mRetVal = errorFI;
deleteSocket();
return ;
}
+ if ( line.left( 8 ) == "ERROR_ED" ) {
+ mRetVal = errorED;
+ deleteSocket();
+ return ;
+ }
mRetVal = errorUN;
deleteSocket();
return ;
}
diff --git a/libkdepim/ksyncmanager.h b/libkdepim/ksyncmanager.h
index bd3ecdc..30ec1e6 100644
--- a/libkdepim/ksyncmanager.h
+++ b/libkdepim/ksyncmanager.h
@@ -77,9 +77,9 @@ class KServerSocket : public QServerSocket
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 );
void writeFile( QString );
void sendStop();