[evolution-data-server/pohly-gnome-2-32: 1/10] e_cal_check_timezones(): broken in 2.30 due to change of error code (GNOME Bugzilla #611558)
- From: Patrick Ohly <pohly src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/pohly-gnome-2-32: 1/10] e_cal_check_timezones(): broken in 2.30 due to change of error code (GNOME Bugzilla #611558)
- Date: Tue, 17 May 2011 08:48:48 +0000 (UTC)
commit 1e3b82862e7ffde93e8b33a9fa1d606d48bdca86
Author: Patrick Ohly <patrick ohly intel com>
Date: Mon Feb 7 10:12:26 2011 +0100
e_cal_check_timezones(): broken in 2.30 due to change of error code (GNOME Bugzilla #611558)
The move to D-Bus changed the error code for "timezone cannot be
retrieved because it doesn't exist" from
E_CALENDAR_STATUS_OBJECT_NOT_FOUND to
E_CALENDAR_STATUS_INVALID_OBJECT. That latter error code was not
recognized by the code and caused e_cal_check_timezones() to fail with
that error ("Could not retrieve calendar time zone").
This patch fixes the problem by recognizing both the old and the new
error code.
calendar/libecal/e-cal-check-timezones.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/calendar/libecal/e-cal-check-timezones.c b/calendar/libecal/e-cal-check-timezones.c
index 01cb31a..a1cff55 100644
--- a/calendar/libecal/e-cal-check-timezones.c
+++ b/calendar/libecal/e-cal-check-timezones.c
@@ -474,8 +474,9 @@ e_cal_tzlookup_ecal (const gchar *tzid,
return zone;
}
- if (g_error_matches (local_error, E_CALENDAR_ERROR,
- E_CALENDAR_STATUS_OBJECT_NOT_FOUND)) {
+ if ((*error)->domain == E_CALENDAR_ERROR &&
+ ((*error)->code == E_CALENDAR_STATUS_OBJECT_NOT_FOUND /* EDS < 2.30 */ ||
+ (*error)->code == E_CALENDAR_STATUS_INVALID_OBJECT /* EDS >= 2.30 */ )) {
/* We had to trigger this error to check for the
* timezone existance, clear it and return NULL. */
g_clear_error (&local_error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]