summaryrefslogtreecommitdiffstats
path: root/kresources/caldav/writer.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-28 01:04:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-28 01:04:18 +0000
commit75502cb30b6b56c4ab65ef7f3e315c3298408937 (patch)
treeac69c6b9094c7c03bde546308c4f43459c34ee21 /kresources/caldav/writer.cpp
parentcfa6b4114cea52b167caaaeb417f98f83edd690f (diff)
downloadtdepim-75502cb30b6b56c4ab65ef7f3e315c3298408937.tar.gz
tdepim-75502cb30b6b56c4ab65ef7f3e315c3298408937.zip
Added tasks support to CalDAV resource
This nearly completes Zimbra integration git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1168963 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources/caldav/writer.cpp')
-rw-r--r--kresources/caldav/writer.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/kresources/caldav/writer.cpp b/kresources/caldav/writer.cpp
index 98008bcd8..4580df514 100644
--- a/kresources/caldav/writer.cpp
+++ b/kresources/caldav/writer.cpp
@@ -28,6 +28,7 @@
// It's done, because, for some reason, SOGo server returns an error
// on caldav_modify_object. DAViCAL works fine both ways.
#define USE_CALDAV_MODIFY
+#define USE_CALDAV_TASKS_MODIFY
/*=========================================================================
| NAMESPACE
@@ -72,6 +73,32 @@ int CalDavWriter::runJob(runtime_info* RT) {
#endif // if USE_CALDAV_MODIFY
}
+ res = OK;
+
+ kdDebug() << "pushing added tasks objects";
+ res = pushTasksObjects(mTasksAdded, caldav_add_object, OK, RT);
+ if ((OK == res) && (tasksUrl() != "")) {
+#ifdef USE_CALDAV_TASKS_MODIFY
+ kdDebug() << "pushing changed objects";
+ res = pushTasksObjects(mTasksChanged, caldav_tasks_modify_object, OK, RT);
+ if (OK == res) {
+ kdDebug() << "pushing deleted objects";
+ res = pushTasksObjects(mTasksDeleted, caldav_tasks_delete_object, OK, RT);
+ }
+#else // if USE_CALDAV_TASKS_MODIFY
+ kdDebug() << "pushing changed objects (delete)";
+ res = pushTasksObjects(mTasksChanged, caldav_tasks_delete_object, OK, RT);
+ if (OK == res) {
+ kdDebug() << "pushing changed objects (add)";
+ res = pushTasksObjects(mTasksChanged, caldav_add_object, OK, RT);
+ if (OK == res) {
+ kdDebug() << "pushing deleted objects";
+ res = pushTasksObjects(mTasksDeleted, caldav_tasks_delete_object, OK, RT);
+ }
+ }
+#endif // if USE_CALDAV_TASKS_MODIFY
+ }
+
if (OK != res) {
clearObjects();
}