KIMAP2
22 #include "message_p.h"
23 #include "session_p.h"
25 #include "kimap_debug.h"
27 using namespace KIMAP2;
31 tags << sessionInternal()->sendCommand(command, args);
32 m_currentCommand = command +
"" + args;
35 Job::Job(Session *session)
36 :
KJob(session), d_ptr(new JobPrivate(session,
"Job"))
40 Job::Job(JobPrivate &dd)
41 :
KJob(dd.m_session), d_ptr(&dd)
50 Session *Job::session()
const
59 d->sessionInternal()->addJob(
this);
62 void Job::handleResponse(
const Message &response)
64 handleErrorReplies(response);
67 void Job::connectionLost()
70 setError(ConnectionLost);
71 setErrorText(
"Connection to server lost: " + d->m_errorMessage);
78 d->m_socketError =
error;
81 void Job::setErrorMessage(
const QString &msg)
84 d->m_errorMessage = msg;
87 Job::HandlerResponse Job::handleErrorReplies(
const Message &response)
92 if (!response.content.isEmpty() &&
93 d->tags.contains(response.content.first().toString())) {
94 if (response.content.size() < 2) {
95 setErrorText(
QString(
"%1 failed, malformed reply from the server.").arg(d->m_name));
96 }
else if (response.content[1].toString() !=
"OK") {
97 setError(CommandFailed);
98 setErrorText(
QString(
"%1 failed, server replied: %2.\n Sent command: %3").arg(d->m_name).
arg(
QLatin1String(response.toString().constData())).
arg(
QString(d->m_currentCommand)));
100 d->tags.removeAll(response.content.first().toString());
101 if (d->tags.isEmpty()) {
Q_SCRIPTABLE Q_NOREPLY void start()
void error(QWidget *parent, const QString &text, const QString &title, const KGuiItem &buttonOk, Options options=Notify)
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 6 2023 04:10:17 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.