summaryrefslogtreecommitdiff
path: root/lib/kolabaccount.cpp
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2012-10-26 15:17:05 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2012-10-26 15:17:05 (GMT)
commit51ed0b5b899caf806a4429e32a9d78391d49f048 (patch)
treebd59af94a3dabe05985819bb9cdf7c326a309404 /lib/kolabaccount.cpp
parent49273576d059c21a3aba58ee4f371b40f12eaf14 (diff)
downloadkolab-utils-51ed0b5b899caf806a4429e32a9d78391d49f048.tar.gz
Kolab v2 as target.
Diffstat (limited to 'lib/kolabaccount.cpp')
-rw-r--r--lib/kolabaccount.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/kolabaccount.cpp b/lib/kolabaccount.cpp
index 8d744a1..6f62555 100644
--- a/lib/kolabaccount.cpp
+++ b/lib/kolabaccount.cpp
@@ -42,11 +42,17 @@ KolabAccount::KolabAccount(QObject* parent)
mSession(0),
mEncryptionMode(KIMAP::LoginJob::TlsV1),
mAuthenticationMode(KIMAP::LoginJob::Plain),
- mDryRun(false)
+ mDryRun(false),
+ mVersion(Kolab::KolabV3)
{
}
+void KolabAccount::setVersion(Kolab::Version version)
+{
+ mVersion = version;
+}
+
void KolabAccount::setHost(const QString& host, qint16 port)
{
mHost = host;
@@ -118,22 +124,23 @@ const char* FlagRecent2 = "\\Recent";
-KMime::Message::Ptr writeObject(const Object &obj)
+KMime::Message::Ptr KolabAccount::writeObject(const Object &obj)
{
+ const QString productId("migration-utility");
KMime::Message::Ptr msg;
if (obj.object.canConvert<KMime::Message::Ptr>()) {
msg = obj.object.value<KMime::Message::Ptr>();
} else if (obj.object.canConvert<KCalCore::Incidence::Ptr>()) {
- msg = Kolab::KolabObjectWriter::writeIncidence(obj.object.value<KCalCore::Incidence::Ptr>());
+ msg = Kolab::KolabObjectWriter::writeIncidence(obj.object.value<KCalCore::Incidence::Ptr>(), mVersion, productId);
} else if (obj.object.canConvert<KABC::Addressee>()) {
- msg = Kolab::KolabObjectWriter::writeContact(obj.object.value<KABC::Addressee>());
+ msg = Kolab::KolabObjectWriter::writeContact(obj.object.value<KABC::Addressee>(), mVersion, productId);
} else if (obj.object.canConvert<KABC::ContactGroup>()) {
- msg = Kolab::KolabObjectWriter::writeDistlist(obj.object.value<KABC::ContactGroup>());
+ msg = Kolab::KolabObjectWriter::writeDistlist(obj.object.value<KABC::ContactGroup>(), mVersion, productId);
} else if (obj.object.canConvert<Note>()) {
- msg = Kolab::KolabObjectWriter::writeNote(obj.object.value<Note>().msg);
+ msg = Kolab::KolabObjectWriter::writeNote(obj.object.value<Note>().msg, mVersion, productId);
} else if (obj.object.canConvert<Dictionary>()) {
const Dictionary dict = obj.object.value<Dictionary>();
- msg = Kolab::KolabObjectWriter::writeDictionary(dict.dict, dict.lang);
+ msg = Kolab::KolabObjectWriter::writeDictionary(dict.dict, dict.lang, mVersion, productId);
} else {
Error() << "Type not handled";
}