summaryrefslogtreecommitdiffstats
path: root/kresources
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-29 18:08:07 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-29 18:08:07 +0000
commit8ce63b1df3d811bb203a9e88cb23ea9a70216c35 (patch)
treed88cbcc03d717201bf5667220290be2d9d6dca22 /kresources
parent5abbdb459be7870848ef16691174e91c68958304 (diff)
downloadtdepim-8ce63b1df3d811bb203a9e88cb23ea9a70216c35.tar.gz
tdepim-8ce63b1df3d811bb203a9e88cb23ea9a70216c35.zip
* Fixed crash when modifying single instance of recurring meeeting in agenda view
* Allow CalDAV tasks read/write to continue even if events read/write failed * Documentation cleanup git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1169577 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kresources')
-rw-r--r--kresources/caldav/reader.cpp15
-rw-r--r--kresources/caldav/writer.cpp31
2 files changed, 28 insertions, 18 deletions
diff --git a/kresources/caldav/reader.cpp b/kresources/caldav/reader.cpp
index 9e167e7d0..02358ba04 100644
--- a/kresources/caldav/reader.cpp
+++ b/kresources/caldav/reader.cpp
@@ -63,20 +63,22 @@ int CalDavReader::runJob(runtime_info* RT) {
caldav_free_response(&result);
- if ((OK == res) && (tasksUrl() != "")) {
+ CALDAV_RESPONSE tasksres = OK;
+
+ if ((OK == tasksres) && (tasksUrl() != "")) {
kdDebug() << "reader::run, url: " << tasksUrl();
result = caldav_get_response();
if (mGetAll) {
kdDebug() << "getting all objects";
- res = caldav_tasks_getall_object(result, std::string(tasksUrl().ascii()).c_str(), RT);
+ tasksres = 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);
+ tasksres = caldav_tasks_get_object(result, mTimeStart.toTime_t(), mTimeEnd.toTime_t(), std::string(tasksUrl().ascii()).c_str(), RT);
}
- if (OK == res) {
+ if (OK == tasksres) {
kdDebug() << "success";
if (result->msg) {
mTasksData = result->msg;
@@ -90,7 +92,10 @@ int CalDavReader::runJob(runtime_info* RT) {
caldav_free_response(&result);
}
- return res;
+ if (tasksres == OK)
+ return res;
+ else
+ return tasksres;
}
// EOF ========================================================================
diff --git a/kresources/caldav/writer.cpp b/kresources/caldav/writer.cpp
index c4101a0b3..de168f363 100644
--- a/kresources/caldav/writer.cpp
+++ b/kresources/caldav/writer.cpp
@@ -75,37 +75,42 @@ int CalDavWriter::runJob(runtime_info* RT) {
}
}
- if ((OK == res) && (tasksUrl() != "")) {
+ int tasksres = OK;
+
+ if ((OK == tasksres) && (tasksUrl() != "")) {
kdDebug() << "pushing added tasks objects";
- res = pushTasksObjects(mTasksAdded, caldav_add_object, OK, RT);
- if (OK == res) {
+ tasksres = pushTasksObjects(mTasksAdded, caldav_add_object, OK, RT);
+ if (OK == tasksres) {
#ifdef USE_CALDAV_TASKS_MODIFY
kdDebug() << "pushing changed objects";
- res = pushTasksObjects(mTasksChanged, caldav_tasks_modify_object, OK, RT);
- if (OK == res) {
+ tasksres = pushTasksObjects(mTasksChanged, caldav_tasks_modify_object, OK, RT);
+ if (OK == tasksres) {
kdDebug() << "pushing deleted objects";
- res = pushTasksObjects(mTasksDeleted, caldav_tasks_delete_object, OK, RT);
+ tasksres = 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) {
+ tasksres = pushTasksObjects(mTasksChanged, caldav_tasks_delete_object, OK, RT);
+ if (OK == tasksres) {
kdDebug() << "pushing changed objects (add)";
- res = pushTasksObjects(mTasksChanged, caldav_add_object, OK, RT);
- if (OK == res) {
+ tasksres = pushTasksObjects(mTasksChanged, caldav_add_object, OK, RT);
+ if (OK == tasksres) {
kdDebug() << "pushing deleted objects";
- res = pushTasksObjects(mTasksDeleted, caldav_tasks_delete_object, OK, RT);
+ tasksres = pushTasksObjects(mTasksDeleted, caldav_tasks_delete_object, OK, RT);
}
}
#endif // if USE_CALDAV_TASKS_MODIFY
}
}
- if (OK != res) {
+ if ((OK != res) || (OK != tasksres)) {
clearObjects();
}
- return res;
+ if (tasksres == OK)
+ return res;
+ else
+ return tasksres;
}
// EOF ========================================================================