diff options
author | Patrick Ohly <patrick.ohly@intel.com> | 2014-07-21 01:07:42 -0700 |
---|---|---|
committer | Patrick Ohly <patrick.ohly@intel.com> | 2014-07-21 10:37:57 +0200 |
commit | b44b45b74207c2710415fd9d040427bdcefb67d4 (patch) | |
tree | 1ed8a74831ff16d622217a59a1790420c610a6e6 | |
parent | 1fdaf6ce6bde4e1128f2380cd20015b90d14398b (diff) |
EDS calendar: cache by TZIDecal
The display name is not necessarily a unique identifier for the content of a
time zone. For example, the 1990 version of CET/CEST might be different from
the 2014 version. Therefore the display name should not be used as identifier.
The TZID is not necessarily better, but at least the code in
e-cal-check-timezones.c tries to verify content equality before reusing an
existing timezone. It also has code which matches time zones based on their
Olson name embedded in the TZID. If that code does not work well enough
(for example, see FDO #81590), then it should be enhanced.
-rw-r--r-- | src/backends/evolution/EvolutionCalendarSource.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/backends/evolution/EvolutionCalendarSource.cpp b/src/backends/evolution/EvolutionCalendarSource.cpp index 68328c2b..267afd93 100644 --- a/src/backends/evolution/EvolutionCalendarSource.cpp +++ b/src/backends/evolution/EvolutionCalendarSource.cpp @@ -549,10 +549,9 @@ EvolutionCalendarSource::InsertItemResult EvolutionCalendarSource::insertItem(co // cannot add a VTIMEZONE without TZID SE_LOG_DEBUG(getDisplayName(), "skipping VTIMEZONE without TZID"); } else { - string timeZoneName(icaltimezone_get_display_name(zone)); // check if the timezone was already registered in EDS // Keeping a cache of already registered timezones will avoid some dbus call of "e_cal_client_add_timezone_sync" - if (find(m_knownTimezones.begin(), m_knownTimezones.end(), timeZoneName) == m_knownTimezones.end()) { + if (find(m_knownTimezones.begin(), m_knownTimezones.end(), tzid) == m_knownTimezones.end()) { gboolean success = #ifdef USE_EDS_CLIENT e_cal_client_add_timezone_sync(m_calendar, zone, NULL, gerror) @@ -564,7 +563,7 @@ EvolutionCalendarSource::InsertItemResult EvolutionCalendarSource::insertItem(co throwError(SE_HERE, string("error adding VTIMEZONE ") + tzid, gerror); } else { - m_knownTimezones.push_back(timeZoneName); + m_knownTimezones.push_back(tzid); } } } |