Bug 158801

Summary: all-day events imported from OpenGroupware ignored
Product: [Applications] korganizer Reporter: Johannes Ballé <os>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: djarvie
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: ics file to reproduce the bug

Description Johannes Ballé 2008-03-05 14:39:11 UTC
Version:            (using KDE 3.5.9)
Installed from:    Ubuntu Packages

All-day events consisting of a single day are ignored entirely by Korganizer. All-day events spanning multiple days are missing the last day. Confirmed this behaviour for 3.5.5, 3.5.8 and 3.5.9. We use the "calendar in remote file" resource to import Opengroupware events. However, the same happens when saving the ics file locally and using the local file.

Attaching example file with sensitive data replaced by XXX. By changing the end date manually with a text editor, you should be able to reproduce the problem.
Comment 1 Johannes Ballé 2008-03-05 14:40:36 UTC
Created attachment 23787 [details]
ics file to reproduce the bug
Comment 2 Johannes Ballé 2008-03-05 15:33:33 UTC
You can easily test this by downloading the attachment and issuing 

korganizer -o calendar.ics
Comment 3 Johannes Ballé 2008-04-18 10:26:03 UTC
After some experimentation, I found out that the custom entry

X-MICROSOFT-CDO-ALLDAYEVENT:TRUE

is the culprit. The corresponding lines are around libkcal/icalformatimpl.cpp:1038:

----------------
  QString msade = event->nonKDECustomProperty("X-MICROSOFT-CDO-ALLDAYEVENT");
  if (!msade.isNull()) {
    bool floats = (msade == QString::fromLatin1("TRUE"));
//    kdDebug(5800) << "ICALFormat::readEvent(): all day event: " << floats << endl;
    event->setFloats(floats);
    if (floats) {
      QDateTime endDate = event->dtEnd();
      event->setDtEnd(endDate.addDays(-1));
    }
  }
----------------

committed by David Jarvie.

The code obviously moves the end date back one day, which makes one-day-appointments disappear completely.

Excellent. A proprietary "amendment" to an open standard by Microsoft causes incompatibility between two entirely open source software components ...
Comment 4 Allen Winter 2008-06-28 22:01:21 UTC
SVN commit 825608 by winterz:

Fix (hopefully, because I have no way to test) all-day events imported from OpenGroupware

David, you could double check this and let me know if it makes sense.
If so I will backport to the 3.5 branch.

BUG: 158801
CCMAIL: djarvie@kde.org


 M  +2 -6      icalformat_p.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=825608