Akonadi
itemserializer.cpp
34bool DefaultItemSerializerPlugin::deserialize(Item &item, const QByteArray &label, QIODevice &data, int /*version*/)
44void DefaultItemSerializerPlugin::serialize(const Item &item, const QByteArray &label, QIODevice &data, int &version)
52bool StdStringItemSerializerPlugin::deserialize(Item &item, const QByteArray &label, QIODevice &data, int /*version*/)
66void StdStringItemSerializerPlugin::serialize(const Item &item, const QByteArray &label, QIODevice &data, int &version)
76void ItemSerializer::deserialize(Item &item, const QByteArray &label, const QByteArray &data, int version, PayloadStorage storage)
96 qCWarning(AKONADICORE_LOG) << "Failed to open" << ((storage == External) ? "external" : "foreign") << "payload:" << file.fileName()
103void ItemSerializer::deserialize(Item &item, const QByteArray &label, QIODevice &data, int version)
118 qCWarning(AKONADICORE_LOG) << "Unable to deserialize payload part:" << label << "in item" << item.id() << "collection" << item.parentCollection().id();
119 qCWarning(AKONADICORE_LOG) << (compressed ? "Decompressed" : "") << "payload data was: " << data;
129 qCWarning(AKONADICORE_LOG) << "Deserialization failed due to decompression error:" << QString::fromStdString(decompressor.error().message());
139void ItemSerializer::serialize(const Item &item, const QByteArray &label, QByteArray &data, int &version)
150void ItemSerializer::serialize(const Item &item, const QByteArray &label, QIODevice &data, int &version)
155 ItemSerializerPlugin *plugin = TypePluginLoader::pluginForMimeTypeAndClass(item.mimeType(), item.availablePayloadMetaTypeIds());
172 ItemSerializerPlugin *plugin = TypePluginLoader::pluginForMimeTypeAndClass(item.mimeType(), item.availablePayloadMetaTypeIds());
181 return TypePluginLoader::pluginForMimeTypeAndClass(item.mimeType(), item.availablePayloadMetaTypeIds())->parts(item);
189 ItemSerializerPlugin *plugin = TypePluginLoader::pluginForMimeTypeAndClass(item.mimeType(), item.availablePayloadMetaTypeIds());
199 ItemSerializerPlugin *plugin = TypePluginLoader::pluginForMimeTypeAndClass(item.mimeType(), item.availablePayloadMetaTypeIds());
205 qCDebug(AKONADICORE_LOG) << "asked to convert a" << item.mimeType() << "item to format" << (mtid ? QMetaType(mtid).name() : "<legacy>");
211 if (ItemSerializerPlugin *const plugin = TypePluginLoader::pluginForMimeTypeAndClass(item.mimeType(), QList<int>(1, mtid), TypePluginLoader::NoDefault)) {
212 qCDebug(AKONADICORE_LOG) << " -> found a plugin that feels responsible, trying serialising the payload";
static const char FullPayload[]
Describes the part name that is used to fetch the full payload of an item.
Definition item.h:126
Helper integration between Akonadi and Qt.
KCOREADDONS_EXPORT unsigned int version()
QString label(StandardShortcut id)
virtual void close() override
virtual bool open(OpenMode flags) override
virtual bool seek(qint64 pos) override
void setBuffer(QByteArray *byteArray)
void setData(const QByteArray &data)
virtual qint64 size() const const override
QByteArray & assign(InputIterator first, InputIterator last)
char * data()
QByteArray fromRawData(const char *data, qsizetype size)
qsizetype size() const const
virtual QString fileName() const const override
bool open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
void setFileName(const QString &name)
virtual void close() override
QString errorString() const const
QByteArray readAll()
virtual bool seek(qint64 pos)
qint64 write(const QByteArray &data)
ReadOnly
const char * name() const const
QString fromStdString(const std::string &str)
QString fromUtf8(QByteArrayView str)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:01:42 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.