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

List:       kde-commits
Subject:    KDE/kdepimlibs/kcal
From:       Allen Winter <winter () kde ! org>
Date:       2008-11-01 0:07:11
Message-ID: 1225498031.883811.21017.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 878370 by winterz:

the VALARM TRIGGER property can be zero and that doesn't mean there's a problem.
if icaldurationtype_is_bad_duration() is true, then just use a 0 duration.
remove the kDebug() statement that there is no trigger time or duration.

btw, the rfc doesn't mention anything about a trigger time; it only
mentions a trigger duration.



 M  +10 -7     icalformat_p.cpp  


--- trunk/KDE/kdepimlibs/kcal/icalformat_p.cpp #878369:878370
@@ -1871,21 +1871,24 @@
     case ICAL_TRIGGER_PROPERTY:
     {
       icaltriggertype trigger = icalproperty_get_trigger( p );
-      if ( icaltime_is_null_time( trigger.time ) ) {
-        if ( icaldurationtype_is_null_duration( trigger.duration ) ) {
-          kDebug() << "Trigger has no time and no duration.";
-        } else {
+      if ( !icaltime_is_null_time( trigger.time ) ) {
+        //set the trigger to a specific time (which is not in rfc2445, btw)
+        ialarm->setTime( readICalUtcDateTime( p, trigger.time, tzlist ) );
+      } else {
+        //set the trigger to an offset from the incidence start or end time.
+        if ( !icaldurationtype_is_bad_duration( trigger.duration ) ) {
           Duration duration( readICalDuration( trigger.duration ) );
           icalparameter *param =
             icalproperty_get_first_parameter( p, ICAL_RELATED_PARAMETER );
           if ( param && icalparameter_get_related( param ) == ICAL_RELATED_END ) {
-            ialarm->setEndOffset(duration);
+            ialarm->setEndOffset( duration );
           } else {
             ialarm->setStartOffset( duration );
           }
+        } else {
+          // a bad duration was encountered, just set a 0 duration from start
+          ialarm->setStartOffset( Duration( 0 ) );
         }
-      } else {
-        ialarm->setTime( readICalUtcDateTime( p, trigger.time, tzlist ) );
       }
       break;
     }
[prev in list] [next in list] [prev in thread] [next in thread] 

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