summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2012-10-25 15:14:29 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2012-10-25 15:14:29 (GMT)
commit1be9bbc228db6107c01334d8fab381f93a9d11e2 (patch)
tree75885228e470e28298774e591bfa9363421b9af2
parentd10bfa66e27b927c0eddfb63e914dd7233e6e44e (diff)
downloadkolab-utils-1be9bbc228db6107c01334d8fab381f93a9d11e2.tar.gz
Tasks are moved as well
-rw-r--r--migrationutility/sourceaccount.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/migrationutility/sourceaccount.cpp b/migrationutility/sourceaccount.cpp
index ff987bd..b039100 100644
--- a/migrationutility/sourceaccount.cpp
+++ b/migrationutility/sourceaccount.cpp
@@ -230,8 +230,14 @@ QPair<Kolab::ObjectType, KMime::Content*> ExchangeIMAPSourceAccount::getObjectTy
Q_FOREACH(KMime::Content *c, msg->contents()) {
Debug() << c->contentType()->mimeType();
if (c->contentType()->mimeType() == calendarType) {
- //TODO maybe distinguish between todos, events, etc
- return QPair<Kolab::ObjectType, KMime::Content*>(Kolab::EventObject, c);
+ KCalCore::ICalFormat format;
+ KCalCore::MemoryCalendar::Ptr calendar(new KCalCore::MemoryCalendar(KDateTime::Spec::UTC()));
+ format.fromRawString(calendar, c->decodedContent());
+ if (!calendar->events().isEmpty()) {
+ return QPair<Kolab::ObjectType, KMime::Content*>(Kolab::EventObject, c);
+ } else if (!calendar->todos().isEmpty()) {
+ return QPair<Kolab::ObjectType, KMime::Content*>(Kolab::TodoObject, c);
+ }
}
if (c->contentType()->mimeType() == vcardType) {
return QPair<Kolab::ObjectType, KMime::Content*>(Kolab::ContactObject, c);
@@ -251,6 +257,9 @@ Kolab::FolderType ExchangeIMAPSourceAccount::getFolderType(const QString &folder
if (type == Kolab::EventObject) {
return Kolab::EventType;
}
+ if (type == Kolab::TodoObject) {
+ return Kolab::TaskType;
+ }
if (type == Kolab::ContactObject) {
return Kolab::ContactType;
}