* Fixed CalDAV resource error messages and potential crash

* Added write support to events with RECURRENCE-ID property
  Only remaining potential issue is modification of parent series and association/update/delete of child event RECURRENCE-ID fields


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1169262 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent ba9ae64c03
commit 5abbdb459b

@ -40,12 +40,14 @@ int CalDavReader::runJob(runtime_info* RT) {
response* result = caldav_get_response();
CALDAV_RESPONSE res = OK;
if (mGetAll) {
kdDebug() << "getting all objects";
res = caldav_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);
if ((OK == res) && (url() != "")) {
if (mGetAll) {
kdDebug() << "getting all objects";
res = caldav_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);
}
}
if (OK == res) {
@ -64,8 +66,7 @@ int CalDavReader::runJob(runtime_info* RT) {
if ((OK == res) && (tasksUrl() != "")) {
kdDebug() << "reader::run, url: " << tasksUrl();
response* result = caldav_get_response();
CALDAV_RESPONSE res = OK;
result = caldav_get_response();
if (mGetAll) {
kdDebug() << "getting all objects";

@ -49,54 +49,56 @@ int CalDavWriter::runJob(runtime_info* RT) {
int res = OK;
kdDebug() << "pushing added objects";
res = pushObjects(mAdded, caldav_add_object, OK, RT);
if (OK == res) {
if ((OK == res) && (url() != "")) {
kdDebug() << "pushing added objects";
res = pushObjects(mAdded, caldav_add_object, OK, RT);
if (OK == res) {
#ifdef USE_CALDAV_MODIFY
kdDebug() << "pushing changed objects";
res = pushObjects(mChanged, caldav_modify_object, OK, RT);
if (OK == res) {
kdDebug() << "pushing deleted objects";
res = pushObjects(mDeleted, caldav_delete_object, OK, RT);
}
kdDebug() << "pushing changed objects";
res = pushObjects(mChanged, caldav_modify_object, OK, RT);
if (OK == res) {
kdDebug() << "pushing deleted objects";
res = pushObjects(mDeleted, caldav_delete_object, OK, RT);
}
#else // if USE_CALDAV_MODIFY
kdDebug() << "pushing changed objects (delete)";
res = pushObjects(mChanged, caldav_delete_object, OK, RT);
if (OK == res) {
kdDebug() << "pushing changed objects (add)";
res = pushObjects(mChanged, caldav_add_object, OK, RT);
if (OK == res) {
kdDebug() << "pushing deleted objects";
res = pushObjects(mDeleted, caldav_delete_object, OK, RT);
}
}
kdDebug() << "pushing changed objects (delete)";
res = pushObjects(mChanged, caldav_delete_object, OK, RT);
if (OK == res) {
kdDebug() << "pushing changed objects (add)";
res = pushObjects(mChanged, caldav_add_object, OK, RT);
if (OK == res) {
kdDebug() << "pushing deleted objects";
res = pushObjects(mDeleted, caldav_delete_object, OK, 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() != "")) {
kdDebug() << "pushing added tasks objects";
res = pushTasksObjects(mTasksAdded, caldav_add_object, OK, RT);
if (OK == res) {
#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);
}
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);
}
}
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) {

@ -487,12 +487,24 @@ void ResourceCached::calendarIncidenceDeleted( Incidence *i )
<< i->uid() << endl;
#endif
TQMap<Incidence *,bool>::ConstIterator it;
it = mDeletedIncidences.find( i );
if ( it == mDeletedIncidences.end() ) {
mDeletedIncidences.insert( i, true );
if (i->hasRecurrenceID()) {
// This incidence has a parent; notify the parent of the child's death and do not destroy the parent!
// Get the parent
IncidenceList il = i->childIncidences();
IncidenceListIterator it;
it = il.begin();
Incidence *parentIncidence;
parentIncidence = this->incidence(*it);
// Remove the child
calendarIncidenceChanged(parentIncidence);
}
else {
TQMap<Incidence *,bool>::ConstIterator it;
it = mDeletedIncidences.find( i );
if ( it == mDeletedIncidences.end() ) {
mDeletedIncidences.insert( i, true );
}
}
checkForAutomaticSave();
}

Loading…
Cancel
Save