KIMAP Library
22 #include "message_p.h"
23 #include "session_p.h"
25 #include <KDE/KLocale>
28 using namespace KIMAP;
30 Job::Job( Session *session )
31 : KJob( session ), d_ptr(new JobPrivate(session, i18n(
"Job")))
36 Job::Job( JobPrivate &dd )
37 : KJob( dd.m_session ), d_ptr(&dd)
47 Session *Job::session()
const
56 d->sessionInternal()->addJob(
this);
59 void Job::handleResponse(
const Message &response)
61 handleErrorReplies(response);
64 void Job::connectionLost()
66 setError( KJob::UserDefinedError );
67 setErrorText( i18n(
"Connection to server lost.") );
71 Job::HandlerResponse Job::handleErrorReplies(
const Message &response)
76 if ( !response.content.isEmpty()
77 && d->tags.contains( response.content.first().toString() ) ) {
78 if ( response.content.size() < 2 ) {
79 setErrorText( i18n(
"%1 failed, malformed reply from the server.", d->m_name) );
80 }
else if ( response.content[1].toString() !=
"OK" ) {
81 setError( UserDefinedError );
82 setErrorText( i18n(
"%1 failed, server replied: %2", d->m_name, response.toString().constData()) );
84 d->tags.removeAll( response.content.first().toString() );
85 if ( d->tags.isEmpty() ) {
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Tue Dec 11 2012 12:12:47 by
doxygen 1.8.1.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.