KIMAP Library
25#include <KDE/KLocalizedString>
30Job::Job( Session *session )
31 : KJob( session ), d_ptr( new JobPrivate( session, i18n(
"Job" ) ) )
35Job::Job( JobPrivate &dd )
36 : KJob( dd.m_session ), d_ptr( &dd )
45Session *Job::session()
const
54 d->sessionInternal()->addJob(
this );
57void Job::handleResponse(
const Message &response)
59 handleErrorReplies( response );
62void Job::connectionLost()
64 setError( KJob::UserDefinedError );
65 setErrorText( i18n(
"Connection to server lost." ) );
69void Job::setSocketError(KTcpSocket::Error error)
72 d->m_socketError = error;
75Job::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-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by
doxygen 1.9.5 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.