summaryrefslogtreecommitdiff
path: root/glib/gtimezone.h
Commit message (Collapse)AuthorAgeFilesLines
* glib: Add SPDX license headers automaticallyPhilip Withnall2022-05-181-0/+2
| | | | | | | | | | | | | | Add SPDX license (but not copyright) headers to all files which follow a certain pattern in their existing non-machine-readable header comment. This commit was entirely generated using the command: ``` git ls-files glib/*.[ch] | xargs perl -0777 -pi -e 's/\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/\n \*\n \* SPDX-License-Identifier: LGPL-2.1-or-later\n \*\n \* This library is free software; you can redistribute it and\/or\n \* modify it under the terms of the GNU Lesser General Public/igs' ``` Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #1415
* gtimezone: Deprecate g_time_zone_new()Philip Withnall2020-11-211-1/+1
| | | | | | | | | | | Use `g_time_zone_new_identifier()` instead so you can get error checking. Adapt the tests to match. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Helps: #553
* gtimezone: Add new constructor which can report errorsPhilip Withnall2020-11-181-0/+3
| | | | | | | | | Add a new variant of `g_time_zone_new()` which returns `NULL` on failure to load a timezone, rather than silently returning UTC. Signed-off-by: Philip Withnall <pwithnall@endlessos.org> Fixes: #553
* gtimezone: Add g_time_zone_new_offset() convenience constructorPhilip Withnall2018-04-131-0/+2
| | | | | | | | This includes tests. Signed-off-by: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=676923
* gtimezone: Add g_time_zone_get_identifier() accessorPhilip Withnall2018-04-121-0/+2
| | | | | | | | | | | | | | | | | | | 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: Philip Withnall <withnall@endlessm.com> https://bugzilla.gnome.org/show_bug.cgi?id=795165
* glib/: LGPLv2+ -> LGPLv2.1+Sébastien Wilmet2017-05-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All glib/*.{c,h} files have been processed, as well as gtester-report. 12 of those files are not licensed under LGPL: gbsearcharray.h gconstructor.h glibintl.h gmirroringtable.h gscripttable.h gtranslit-data.h gunibreak.h gunichartables.h gunicomp.h gunidecomp.h valgrind.h win_iconv.c Some of them are generated files, some are licensed under a BSD-style license and win_iconv.c is in the public domain. Sub-directories inside glib/: deprecated/: processed in a previous commit glib-mirroring-tab/: already LGPLv2.1+ gnulib/: not modified, the code is copied from gnulib libcharset/: a copy pcre/: a copy tests/: processed in a previous commit https://bugzilla.gnome.org/show_bug.cgi?id=776504
* Updated FSF's addressDaniel Mustieles2014-01-311-3/+1
|
* various: add GLIB_AVAILABLE_IN_ALL everywhere elseRyan Lortie2013-01-131-0/+10
| | | | | | | | | | | Add the GLIB_AVAILABLE_IN_ALL annotation to all old functions (that haven't already been annotated with the GLIB_AVAILABLE_IN_* macros or a deprecation macro). If we discover in the future that we cannot use only one macro on Windows, it will be an easy sed patch to fix that. https://bugzilla.gnome.org/show_bug.cgi?id=688681
* Move single-include guards inside include guardsMatthias Clasen2012-12-271-3/+3
| | | | | | gcc has optimizations for include guards that only work if they are outermost in the the header. https://bugzilla.gnome.org/show_bug.cgi?id=689810
* Make single includes mandatoryMatthias Clasen2011-10-121-1/+1
| | | | | This has been the official line since 2.17, which seems plenty long enough for a transition phase.
* GTimeZoneMonitor: Revert addition of this classColin Walters2011-08-221-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | The main rationale for adding it was to avoid having gnome-shell mmap'ing /etc/localtime once a second. However, we can just as easily run inotify there, and given no one else was clamoring for a way to detect when the time zone changes, I don't see a need for public API here - at least not yet. In the bigger picture, I just don't believe that the vast majority of applications are going to go out of their way to instantiate and keep around a random GTimeZoneMonitor class. And if they do, it's has the side effect that for other bits of code in the process, local GDateTime instances may start varying again! So, if code can't rely on local GDateTime instances being in a consistent state anyways, let's just do that always. The documentation now says that this is the case. Applications have always been able to work in a consistent local time zone by instantiating a zone and then using it for GDateTime constructors. We fix the "gnome-shell stats /etc/localtime once a second" issue by using timerfd (in glib) and inotify (in gnome-shell). https://bugzilla.gnome.org/show_bug.cgi?id=655129
* Fix a few parameter mismatches in the docsMatthias Clasen2011-04-111-2/+2
|
* g_time_zone_new_local: cache the resultRyan Lortie2011-03-311-0/+2
| | | | Add a function to drop the cache.
* Clean-up/tweaking of GDateTime and GTimeZoneRyan Lortie2010-09-171-0/+81