[evolution-data-server/treitter-client-gdbus] Bug #347845 - Early Hour AM iCal Calendar Entries Do Not Load
- From: Travis Reitter <treitter src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [evolution-data-server/treitter-client-gdbus] Bug #347845 - Early Hour AM iCal Calendar Entries Do Not Load
- Date: Thu, 3 Dec 2009 00:52:13 +0000 (UTC)
commit 0c11047ab045144b28b50adf820377dea31c77a2
Author: Milan Crha <mcrha redhat com>
Date: Wed Nov 25 22:36:30 2009 +0100
Bug #347845 - Early Hour AM iCal Calendar Entries Do Not Load
calendar/libedata-cal/e-cal-backend-sync.c | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/calendar/libedata-cal/e-cal-backend-sync.c b/calendar/libedata-cal/e-cal-backend-sync.c
index 8764067..a503ab0 100644
--- a/calendar/libedata-cal/e-cal-backend-sync.c
+++ b/calendar/libedata-cal/e-cal-backend-sync.c
@@ -947,18 +947,26 @@ _e_cal_backend_add_timezone (ECalBackend *backend, EDataCal *cal, EServerMethodC
static icaltimezone *
_e_cal_backend_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
{
- gint i, slashes = 0;
+ icaltimezone *zone = NULL;
+ const gchar *s, *slash1 = NULL, *slash2 = NULL;
if (!tzid || !*tzid)
return NULL;
- for (i = 0; tzid [i]; i++) {
- if (tzid [i] == '/')
- slashes++;
+ /* get builtin by a location, if any */
+ for (s = tzid; *s; s++) {
+ if (*s == '/') {
+ slash1 = slash2;
+ slash2 = s;
+ }
}
- /* try if it contains only location of the timezone */
- return slashes == 1 ? icaltimezone_get_builtin_timezone (tzid) : NULL;
+ if (slash1)
+ zone = icaltimezone_get_builtin_timezone (slash1 + 1);
+ else if (slash2)
+ zone = icaltimezone_get_builtin_timezone (tzid);
+
+ return zone;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]