[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-21 2:32:39
Message-ID: 1227234759.319054.6647.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 887084 by winterz:

fix parseScheduleMessage() to work better with the new libical.
I really don't know how it worked at all before.

BUG: 175345


 M  +8 -15     icalformat.cpp  


--- trunk/KDE/kdepimlibs/kcal/icalformat.cpp #887083:887084
@@ -262,7 +262,8 @@
 
   // time zones
   const ICalTimeZones::ZoneMap zones = tzUsedList.zones();
-  for ( ICalTimeZones::ZoneMap::ConstIterator it = zones.constBegin();  it != \
zones.constEnd();  ++it ) { +  for ( ICalTimeZones::ZoneMap::ConstIterator \
it=zones.constBegin(); +        it != zones.constEnd(); ++it ) {
     icaltimezone *tz = (*it).icalTimezone();
     if ( !tz ) {
       kError() << "bad time zone";
@@ -477,8 +478,6 @@
     return 0;
   }
 
-  kDebug() << "getting method...";
-
   icalproperty_method icalmethod = icalproperty_get_method( m );
   iTIPMethod method;
 
@@ -513,8 +512,6 @@
     break;
   }
 
-  kDebug() << "restriction...";
-
   if ( !icalrestriction_check( message ) ) {
     kWarning() << endl
                << "kcal library reported a problem while parsing:";
@@ -522,7 +519,7 @@
                << d->mImpl->extractErrorProperty( c );
   }
 
-  Incidence *existingIncidence = cal->incidenceFromSchedulingID( incidence->uid() );
+  Incidence *existingIncidence = cal->incidence( incidence->uid() );
 
   icalcomponent *calendarComponent = 0;
   if ( existingIncidence ) {
@@ -540,15 +537,14 @@
       icalcomponent_add_component( calendarComponent,
                                    d->mImpl->writeEvent( event ) );
     }
+  } else {
+    icalcomponent_free( message );
+    return new ScheduleMessage( incidence, method, ScheduleMessage::Unknown );
   }
 
-  kDebug() << "classify...";
-
   icalproperty_xlicclass result =
     icalclassify( message, calendarComponent, (char *)"" );
 
-  kDebug() << "returning with result = " << result;
-
   ScheduleMessage::Status status;
 
   switch ( result ) {
@@ -573,12 +569,9 @@
     break;
   }
 
-  kDebug() << "status =" << status;
-
   icalcomponent_free( message );
-  if ( calendarComponent ) {
-    icalcomponent_free( calendarComponent );
-  }
+  icalcomponent_free( calendarComponent );
+
   return new ScheduleMessage( incidence, method, status );
 }
 


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

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