summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2014-11-10 11:24:07 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2014-11-10 11:24:07 (GMT)
commite6cee1d7b304036ab7599283e749425b1ad2bbac (patch)
treecdd01bb40b904adafa6b0cae06ff49e506ca99ba
parent0c06b90ec66255285327798d1436e14144765b7f (diff)
downloadlibkolab-e6cee1d7b304036ab7599283e749425b1ad2bbac.tar.gz
Forgot to ifdef the writing part.
-rw-r--r--kolabformat/kolabobject.cpp34
-rw-r--r--kolabformat/kolabobject.h4
2 files changed, 19 insertions, 19 deletions
diff --git a/kolabformat/kolabobject.cpp b/kolabformat/kolabobject.cpp
index 9aed0b7..65918d1 100644
--- a/kolabformat/kolabobject.cpp
+++ b/kolabformat/kolabobject.cpp
@@ -792,23 +792,6 @@ KMime::Message::Ptr writeRelationHelper(const Kolab::Relation &relation, const Q
return Mime::createMessage(Conversion::fromStdString(configuration.uid()), kolabMimeType(), relationKolabType(), Conversion::fromStdString(v3String).toUtf8(), true, getProductId(productId));
}
-KMime::Message::Ptr KolabObjectWriter::writeRelation(const Akonadi::Relation &relation, Version v, const QString &productId)
-{
- ErrorHandler::clearErrors();
- if (v != KolabV3) {
- Critical() << "only v3 implementation available";
- }
-
- Kolab::Relation kolabRelation(std::string(), "generic");
- std::vector<std::string> m;
- m.reserve(2);
- m.push_back(Conversion::toStdString(QString::number(relation.left().id())));
- m.push_back(Conversion::toStdString(QString::number(relation.right().id())));
- kolabRelation.setMembers(m);
-
- return writeRelationHelper(kolabRelation, relation.remoteId(), productId);
-}
-
KMime::Message::Ptr KolabObjectWriter::writeTag(const Akonadi::Tag &tag, const QStringList &members, Version v, const QString &productId)
{
ErrorHandler::clearErrors();
@@ -828,9 +811,24 @@ KMime::Message::Ptr KolabObjectWriter::writeTag(const Akonadi::Tag &tag, const Q
}
#endif
+#ifdef HAVE_RELATION_H
+KMime::Message::Ptr KolabObjectWriter::writeRelation(const Akonadi::Relation &relation, Version v, const QString &productId)
+{
+ ErrorHandler::clearErrors();
+ if (v != KolabV3) {
+ Critical() << "only v3 implementation available";
+ }
+ Kolab::Relation kolabRelation(std::string(), "generic");
+ std::vector<std::string> m;
+ m.reserve(2);
+ m.push_back(Conversion::toStdString(QString::number(relation.left().id())));
+ m.push_back(Conversion::toStdString(QString::number(relation.right().id())));
+ kolabRelation.setMembers(m);
-
+ return writeRelationHelper(kolabRelation, relation.remoteId(), productId);
+}
+#endif
}; //Namespace
diff --git a/kolabformat/kolabobject.h b/kolabformat/kolabobject.h
index bc6d6e2..378a172 100644
--- a/kolabformat/kolabobject.h
+++ b/kolabformat/kolabobject.h
@@ -142,9 +142,11 @@ public:
static KMime::Message::Ptr writeDictionary(const QStringList &, const QString &lang, Version v = KolabV3, const QString &productId = QString());
static KMime::Message::Ptr writeFreebusy(const Kolab::Freebusy &, Version v = KolabV3, const QString &productId = QString());
#ifdef HAVE_TAG_H
- static KMime::Message::Ptr writeRelation(const Akonadi::Relation &, Version v = KolabV3, const QString &productId = QString());
static KMime::Message::Ptr writeTag(const Akonadi::Tag &, const QStringList &items, Version v = KolabV3, const QString &productId = QString());
#endif
+#ifdef HAVE_RELATION_H
+ static KMime::Message::Ptr writeRelation(const Akonadi::Relation &, Version v = KolabV3, const QString &productId = QString());
+#endif
};