[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim] [Patch] Support for Microsoft All-Day-Events in libkcal
From:       "Best, Jan-Pascal van" <j.p.vanbest () tbm ! tudelft ! nl>
Date:       2002-06-06 12:19:48
[Download RAW message or body]

Hi all,

I'd like the following patch to go into
kdepim/libkcal/icalformat.impl.cpp
It adds support for interpreting the X-MICROSOFT-CDO-ALLDAYEVENT
property
in the ical format. Microsoft Exchange uses this to tag all-day events. 
My patch sets the "floats" flag for the event is this flag is set to
TRUE.
It also decreases the end date of the event by one day, since MS sets
the
end date to the day AFTER the last occurrence.

What do you think?

Cheers

Jan-Pascal

Index: icalformatimpl.cpp
===================================================================
RCS file: /home/kde/kdepim/libkcal/icalformatimpl.cpp,v
retrieving revision 1.49
diff -u -3 -p -r1.49 icalformatimpl.cpp
--- icalformatimpl.cpp  2002/06/02 00:42:35     1.49
+++ icalformatimpl.cpp  2002/06/06 12:14:27
@@ -1013,6 +1013,20 @@ Event *ICalFormatImpl::readEvent(icalcom
         mEventsRelate.append(event);
         break;

+      case ICAL_X_PROPERTY:
+        if
(strcmp(icalproperty_get_name(p),"X-MICROSOFT-CDO-ALLDAYEVENT") == 0) {
+         text = icalproperty_get_value_as_string(p);
+         bool floats = (strcmp(text, "TRUE") == 0);
+         kdDebug(5800) << "ICALFormat::readEvent(): all day event: " <<
floats << endl;
+         event->setFloats(floats);
+         if (floats) {
+           QDateTime endDate = event->dtEnd();
+           event->setDtEnd(endDate.addDays(-1));
+         }
+       }
+        break;
+
+
       default:
 //        kdDebug(5800) << "ICALFormat::readEvent(): Unknown property:
" << kind
 //                  << endl;
_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
http://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic