-rw-r--r-- | libkdepim/ksyncmanager.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 47d00a4..d59f4a4 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -1071,21 +1071,23 @@ void KSyncManager::deleteCommandSocket(KCommandSocket*s, int state) { //enum { success, errorW, errorR, quiet }; 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 ) { KCommandSocket* commandSocket = new KCommandSocket( mPassWordPiSync, mActiveSyncPort.toUInt(), mActiveSyncIP, this, mParent->topLevelWidget()); connect( commandSocket, SIGNAL(commandFinished( KCommandSocket*, int)), this, SLOT(deleteCommandSocket(KCommandSocket*, int )) ); @@ -1180,13 +1182,13 @@ void KServerSocket::readClient() if ( mSocket == 0 ) { qDebug("ERROR::KSS::readClient(): mSocket == 0 "); 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()"); if ( mSocket->canReadLine() ) { QString line = mSocket->readLine(); @@ -1226,18 +1228,21 @@ void KServerSocket::readClient() end_connect(); } } } 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 ); os << errmess ; mSocket->close(); @@ -1262,13 +1267,13 @@ void KServerSocket::send_file() QVBoxLayout* lay = new QVBoxLayout( mSyncActionDialog ); lay->addWidget( label); 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 ) { QString warning = i18n("Clock skew of\nsyncing devices\nis %1 seconds!").arg( secs ); @@ -1518,12 +1523,17 @@ void KCommandSocket::readFileFromSocket() } if ( line.left( 8 ) == "ERROR_FI" ) { mRetVal = errorFI; deleteSocket(); return ; } + if ( line.left( 8 ) == "ERROR_ED" ) { + mRetVal = errorED; + deleteSocket(); + return ; + } mRetVal = errorUN; deleteSocket(); return ; } } mFileString += line; |