KIMAP
9 #include "response_p.h"
10 #include "session_p.h"
12 #include "kimap_debug.h"
13 #include <KLocalizedString>
15 using namespace KIMAP;
17 Job::Job(Session *session)
19 , d_ptr(new JobPrivate(session,
i18n(
"Job")))
23 Job::Job(JobPrivate &dd)
34 Session *Job::session()
const
43 d->sessionInternal()->addJob(
this);
46 void Job::handleResponse(
const Response &response)
48 handleErrorReplies(response);
51 void Job::connectionLost()
53 setError(KJob::UserDefinedError);
54 setErrorText(
i18n(
"Connection to server lost."));
58 Job::HandlerResponse Job::handleErrorReplies(
const Response &response)
63 if (!response.content.isEmpty() && d->tags.contains(response.content.first().toString())) {
64 if (response.content.size() < 2) {
65 setErrorText(
i18n(
"%1 failed, malformed reply from the server.", d->m_name));
66 }
else if (response.content[1].toString() !=
"OK") {
67 setError(UserDefinedError);
68 setErrorText(
i18n(
"%1 failed, server replied: %2", d->m_name,
QLatin1String(response.toString().constData())));
70 d->tags.removeAll(response.content.first().toString());
71 if (d->tags.isEmpty()) {
80 #include "moc_job.cpp"
Q_SCRIPTABLE Q_NOREPLY void start()
QString i18n(const char *text, const TYPE &arg...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 10 2023 03:48:59 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.