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

List:       kde-commits
Subject:    KDE/kdepim/libkcal
From:       Will Stephenson <lists () stevello ! free-online ! co ! uk>
Date:       2005-06-15 13:50:08
Message-ID: 1118843408.453014.6265.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 425750 by wstephens:

ICalFormat::parseScheduleMessage() should guarantee that
( msg == 0 ) -> ( ICalFormat::exception() points to a valid Exception ).



 M  +16 -4     icalformat.cpp  
 M  +1 -0      incidenceformatter.cpp  


--- trunk/KDE/kdepim/libkcal/icalformat.cpp #425749:425750
@@ -386,16 +386,27 @@
   setTimeZone( cal->timeZoneId(), !cal->isLocalTime() );
   clearException();
 
-  if (messageText.isEmpty()) return 0;
-
+  if (messageText.isEmpty())
+  {
+    setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, QString::fromLatin1( \
"messageText was empty, unable to parse into a ScheduleMessage" ) ) ); +    return 0;
+  }
   icalcomponent *message;
   message = icalparser_parse_string(messageText.utf8());
 
-  if (!message) return 0;
+  if (!message)
+  {
+    setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, QString::fromLatin1( \
"icalparser was unable to parse messageText into a ScheduleMessage" ) ) ); +    \
return 0; +  }
 
   icalproperty *m = icalcomponent_get_first_property(message,
                                                      ICAL_METHOD_PROPERTY);
-  if (!m) return 0;
+  if (!m)
+  {
+    setException( new ErrorFormat( ErrorFormat::ParseErrorKcal, QString::fromLatin1( \
"message didn't contain an ICAL_METHOD_PROPERTY" ) ) ); +    return 0;
+  }
 
   icalcomponent *c;
 
@@ -431,6 +442,7 @@
 
   if (!incidence) {
     kdDebug(5800) << "ICalFormat:parseScheduleMessage: object is not a freebusy, \
event, todo or journal" << endl; +    setException( new ErrorFormat( \
ErrorFormat::ParseErrorKcal, QString::fromLatin1( "object is not a freebusy, event, \
todo or journal" ) ) );  return 0;
   }
 
--- trunk/KDE/kdepim/libkcal/incidenceformatter.cpp #425749:425750
@@ -891,6 +891,7 @@
 
   if( !msg ) {
     kdDebug( 5850 ) << "Failed to parse the scheduling message" << endl;
+    Q_ASSERT( format.exception() );
     kdDebug( 5850 ) << format.exception()->message() << endl;
     return QString::null;
   }


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

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