20#ifndef AKONADI_MOVEJOBIMPL_P_H
21#define AKONADI_MOVEJOBIMPL_P_H
23#include "collection.h"
26#include "protocolhelper_p.h"
28#include <KLocalizedString>
33template <
typename T,
typename MoveJob>
class MoveJobImpl :
public JobPrivate
36 MoveJobImpl(
Job *parent)
41 inline void sendCommand(
const char *asapCommand)
43 MoveJob *q =
static_cast<MoveJob *
>(q_func());
44 if (objectsToMove.isEmpty()) {
46 q->setErrorText(i18n(
"No objects specified for moving"));
50 if (!destination.isValid() && destination.remoteId().isEmpty()) {
52 q->setErrorText(i18n(
"No valid destination specified"));
57 QByteArray command =
newTag();
60 }
catch (
const std::exception &e) {
62 q->setErrorText(QString::fromUtf8(e.what()));
68 if (objectsToMove.first().isValid()) {
69 command += QByteArray::number(destination.id());
71 command += ImapParser::quote(destination.remoteId().toUtf8());
75 if (source.isValid()) {
76 command +=
' ' + QByteArray::number(source.id());
77 }
else if (!source.remoteId().isEmpty()) {
78 command +=
' ' + ImapParser::quote(source.remoteId().toUtf8());
84 typename T::List objectsToMove;
Represents a collection of PIM items.
void writeData(const QByteArray &data)
Sends raw data to the backend.
QByteArray newTag()
Returns a new unique command tag for communication with the backend.
Base class for all actions in the Akonadi storage.
static QByteArray entitySetToByteArray(const QList< T > &_objects, const QByteArray &command)
Converts the given set of items into a protocol representation.
FreeBusyManager::Singleton.
This file is part of the KDE documentation.
Documentation copyright © 1996-2026 The KDE developers.
Generated on
by
doxygen 1.15.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.