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 Job::HandlerResponse Job::handleErrorReplies(
const Message &response)
74 if ( !response.content.isEmpty() &&
75 d->tags.contains( response.content.first().toString() ) ) {
76 if ( response.content.size() < 2 ) {
77 setErrorText( i18n(
"%1 failed, malformed reply from the server.", d->m_name ) );
78 }
else if ( response.content[1].toString() !=
"OK" ) {
79 setError( UserDefinedError );
80 setErrorText( i18n(
"%1 failed, server replied: %2", d->m_name, QLatin1String(response.toString().constData()) ) );
82 d->tags.removeAll( response.content.first().toString() );
83 if ( d->tags.isEmpty() ) {
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:08 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.