Re: [Evolution-hackers] [PATCH][RFC] Deal with negative intervals

2011-02-22 Thread Carlos Martín Nieto
On Wed, 2011-02-23 at 10:22 +1300, Andrew McMillan wrote:
 [...]
 My only quibble is that any program should report on a client that
 creates bogus data, so I should like to see some kind of warning message
 written in the logs at this point.

 Good point. The patch I've just pushed uses g_warning() to say what
rule caused the error (as I don't think we can get any other
information).

   cmn
-- 
Carlos Martín Nietohttp://www.cmartin.tk

¿Cómo voy a decir bobadas si soy mudo? -- CACHAI


signature.asc
Description: This is a digitally signed message part
___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers


[Evolution-hackers] [PATCH][RFC] Deal with negative intervals

2011-02-21 Thread Carlos Martín Nieto
Hi,

 Dealing with the error I posted about on another thread, I found that
Google is giving me some recurring events with an interval of -1, which
causes evo to search for all years from 2011 to -1, when it errors out
because it's no longer a valid time_t (which I guess also explains why
it sometimes seems to stop responding for a bit).

 I'm not sure how I managed to create them, but the Google calendar web
interface manages to display them correctly. As a fix for this
behaviour, I've changed the library to use the absolute value (which
also has the added advantage that these entries are now displayed).

 I can push the change in myself if people are in favour, but I wanted
to ask, as this could be considered quite wrong.

   cmn

---
 calendar/libecal/e-cal-recur.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/calendar/libecal/e-cal-recur.c
b/calendar/libecal/e-cal-recur.c
index 3c30618..87e430c 100644
--- a/calendar/libecal/e-cal-recur.c
+++ b/calendar/libecal/e-cal-recur.c
@@ -996,7 +996,8 @@ e_cal_recur_from_icalproperty (icalproperty *prop,
gboolean exception,
ir = icalproperty_get_rrule (prop);
 
r-freq = ir.freq;
-   r-interval = ir.interval;
+   /* Invervals of -1 have been spotted in the wild (Google) */
+   r-interval = abs(ir.interval);
 
   r-enddate = e_cal_recur_obtain_enddate (ir, prop, zone,
convert_end_date);

-- 
Carlos Martín Nietohttp://www.cmartin.tk

¿Cómo voy a decir bobadas si soy mudo? -- CACHAI


signature.asc
Description: This is a digitally signed message part
___
evolution-hackers mailing list
evolution-hackers@gnome.org
To change your list options or unsubscribe, visit ...
http://mail.gnome.org/mailman/listinfo/evolution-hackers