Skip to content
  • Philip Withnall's avatar
    gtimezone: Add g_time_zone_get_identifier() accessor · 89452277
    Philip Withnall authored
    
    
    This is a non-trivial accessor which gets the identifier string used to
    create the GTimeZone — unless the string passed to g_time_zone_new() was
    invalid, in which case the identifier will be `UTC`.
    
    Implementing this required reworking how timezone information was loaded
    so that the tz->name is always set at the same time as tz->t_info, so
    they are in sync. Previously, the tz->name was unconditionally set to
    whatever was passed to g_time_zone_new(), and then not updated if the
    tz->t_info was eventually set to the default UTC information.
    
    This includes tests for the new g_time_zone_get_identifier() API, and
    for the g_date_time_get_timezone() API added in the previous commit.
    
    Signed-off-by: default avatarPhilip Withnall <withnall@endlessm.com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795165
    89452277