20#include "namespacejob.h"
22#include "kimap_debug.h"
36 if (data.
at(0) !=
'(') {
39 bool parsingString =
false;
41 for (
int pos = 1; pos < data.
size(); pos++) {
43 if (data.
at(pos) ==
'\"' && data.
at(pos - 1) !=
'\\') {
45 parsingString =
false;
58class NamespaceJobPrivate :
public JobPrivate
61 NamespaceJobPrivate(
Session *session,
const QString &name) : JobPrivate(session,
name) { }
62 ~NamespaceJobPrivate() { }
68 foreach (
const QByteArray &namespaceItem, namespaceList) {
70 if (parts.
size() < 2) {
71 qWarning() <<
"Not enough parts in namespace item " << namespaceItem;
74 MailBoxDescriptor descriptor;
90using namespace KIMAP2;
92NamespaceJob::NamespaceJob(
Session *session)
93 : Job(*new NamespaceJobPrivate(session,
"Namespace"))
97NamespaceJob::~NamespaceJob()
103 Q_D(
const NamespaceJob);
104 return d->personalNamespaces;
109 Q_D(
const NamespaceJob);
110 return d->userNamespaces;
115 Q_D(
const NamespaceJob);
116 return d->sharedNamespaces;
119bool NamespaceJob::containsEmptyNamespace()
const
121 Q_D(
const NamespaceJob);
124 + d->sharedNamespaces;
126 foreach (
const MailBoxDescriptor &descriptor, completeList) {
127 if (descriptor.name.
isEmpty()) {
135void NamespaceJob::doStart()
138 d->sendCommand(
"NAMESPACE", {});
141void NamespaceJob::handleResponse(
const Message &response)
144 if (handleErrorReplies(response) == NotHandled) {
145 if (response.content.size() >= 5 &&
146 response.content[1].toString() ==
"NAMESPACE") {
148 d->personalNamespaces = d->processNamespaceList(response.content[2].toList());
151 d->userNamespaces = d->processNamespaceList(response.content[3].toList());
154 d->sharedNamespaces = d->processNamespaceList(response.content[4].toList());
Q_SCRIPTABLE Q_NOREPLY void start()
QString name(GameStandardAction id)
char at(qsizetype i) const const
bool isEmpty() const const
QByteArray mid(qsizetype pos, qsizetype len) const const
qsizetype size() const const
qsizetype size() const const
QString fromUtf8(QByteArrayView str)
bool isEmpty() const const
This file is part of the IMAP support library and defines the RfcCodecs class.
KIMAP2_EXPORT QByteArray decodeImapFolderName(const QByteArray &inSrc)
Converts an UTF-7 encoded IMAP mailbox to a QByteArray.