diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2015-07-09 16:04:19 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2015-07-09 16:04:19 -0500 |
commit | 508e44524cad75e259c8c53a24d174cb2c16d753 (patch) | |
tree | c888fbcd8adbe0a3cc278e16001aea2060be80bf /src | |
parent | b6bdb4e57cfed4d75e8d3b4bf0c738c969929763 (diff) | |
download | ayatana-indicator-datetime-508e44524cad75e259c8c53a24d174cb2c16d753.tar.gz ayatana-indicator-datetime-508e44524cad75e259c8c53a24d174cb2c16d753.tar.bz2 ayatana-indicator-datetime-508e44524cad75e259c8c53a24d174cb2c16d753.zip |
add a g_warning() if we can't suss out the tzid
Diffstat (limited to 'src')
-rw-r--r-- | src/engine-eds.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/engine-eds.cpp b/src/engine-eds.cpp index 746b9af..d9efa5f 100644 --- a/src/engine-eds.cpp +++ b/src/engine-eds.cpp @@ -739,19 +739,24 @@ private: GTimeZone * gtz {}; if (in.tzid != nullptr) { - const char * tzid {}; - icaltimezone * itz {}; - - itz = icaltimezone_get_builtin_timezone_from_tzid(in.tzid); // usually works + auto itz = icaltimezone_get_builtin_timezone_from_tzid(in.tzid); // usually works if (itz == nullptr) // fallback itz = icaltimezone_get_builtin_timezone(in.tzid); - if (itz == nullptr) // ok, I give up... make a round trip on the bus to ask EDS to look it up in VTIMEZONES + if (itz == nullptr) // ok we have a strange tzid... ask EDS to look it up in VTIMEZONES e_cal_client_get_timezone_sync(client, in.tzid, &itz, cancellable.get(), nullptr); + const char * tzid; if (itz != nullptr) + { tzid = icaltimezone_get_location(itz); + } + else + { + g_warning("Unrecognized TZID: '%s'", in.tzid); + tzid = nullptr; + } gtz = g_time_zone_new(tzid); g_debug("%s eccdt.tzid -> offset is %d", G_STRLOC, in.tzid, (int)g_time_zone_get_offset(gtz,0)); |