diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-28 01:04:18 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-28 01:04:18 +0000 |
commit | 75502cb30b6b56c4ab65ef7f3e315c3298408937 (patch) | |
tree | ac69c6b9094c7c03bde546308c4f43459c34ee21 /kresources/caldav/reader.cpp | |
parent | cfa6b4114cea52b167caaaeb417f98f83edd690f (diff) | |
download | tdepim-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/reader.cpp')
-rw-r--r-- | kresources/caldav/reader.cpp | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/kresources/caldav/reader.cpp b/kresources/caldav/reader.cpp index 7d912a7f8..4a65b2ab9 100644 --- a/kresources/caldav/reader.cpp +++ b/kresources/caldav/reader.cpp @@ -31,6 +31,7 @@ using namespace KCal; void CalDavReader::cleanJob() { CalDavJob::cleanJob(); mData = ""; + mTasksData = ""; } int CalDavReader::runJob(runtime_info* RT) { @@ -41,10 +42,10 @@ int CalDavReader::runJob(runtime_info* RT) { if (mGetAll) { kdDebug() << "getting all objects"; - res = caldav_getall_object(result, std::string(url().ascii()).c_str(), RT); + res = caldav_tasks_getall_object(result, std::string(url().ascii()).c_str(), RT); } else { kdDebug() << "getting object from the specified time range"; - res = caldav_get_object(result, mTimeStart.toTime_t(), mTimeEnd.toTime_t(), std::string(url().ascii()).c_str(), RT); + res = caldav_tasks_get_object(result, mTimeStart.toTime_t(), mTimeEnd.toTime_t(), std::string(url().ascii()).c_str(), RT); } if (OK == res) { @@ -60,6 +61,34 @@ int CalDavReader::runJob(runtime_info* RT) { caldav_free_response(&result); + if ((OK == res) && (tasksUrl() != "")) { + kdDebug() << "reader::run, url: " << tasksUrl(); + + response* result = caldav_get_response(); + CALDAV_RESPONSE res = OK; + + if (mGetAll) { + kdDebug() << "getting all objects"; + res = caldav_tasks_getall_object(result, std::string(tasksUrl().ascii()).c_str(), RT); + } else { + kdDebug() << "getting object from the specified time range"; + res = caldav_tasks_get_object(result, mTimeStart.toTime_t(), mTimeEnd.toTime_t(), std::string(tasksUrl().ascii()).c_str(), RT); + } + + if (OK == res) { + kdDebug() << "success"; + if (result->msg) { + mTasksData = result->msg; + } else { + kdDebug() << "empty collection"; + // empty collection + mTasksData = ""; + } + } + + caldav_free_response(&result); + } + return res; } |