KIMAP Library
22 #include "message_p.h"
23 #include "session_p.h"
25 #include <KDE/KLocalizedString>
28 using namespace KIMAP;
30 Job::Job( Session *session )
31 : KJob( session ), d_ptr( new JobPrivate( session, i18n(
"Job" ) ) )
35 Job::Job( JobPrivate &dd )
36 : KJob( dd.m_session ), d_ptr( &dd )
45 Session *Job::session()
const
54 d->sessionInternal()->addJob(
this );
57 void Job::handleResponse(
const Message &response)
59 handleErrorReplies( response );
62 void Job::connectionLost()
64 setError( KJob::UserDefinedError );
65 setErrorText( i18n(
"Connection to server lost." ) );
69 void Job::setSocketError(KTcpSocket::Error error)
72 d->m_socketError = error;
75 Job::HandlerResponse Job::handleErrorReplies(
const Message &response)
80 if ( !response.content.isEmpty() &&
81 d->tags.contains( response.content.first().toString() ) ) {
82 if ( response.content.size() < 2 ) {
83 setErrorText( i18n(
"%1 failed, malformed reply from the server.", d->m_name ) );
84 }
else if ( response.content[1].toString() !=
"OK" ) {
85 setError( UserDefinedError );
86 setErrorText( i18n(
"%1 failed, server replied: %2", d->m_name,
QLatin1String(response.toString().constData()) ) );
88 d->tags.removeAll( response.content.first().toString() );
89 if ( d->tags.isEmpty() ) {
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:37:03 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.