[Xfce4-commits] r27985 - in xfcalendar/trunk: . src
Yves-Alexis Perez
corsac at debian.org
Tue Sep 30 07:46:04 CEST 2008
On lun, 2008-09-29 at 18:09 +0000, Juha Kautto wrote:
> Author: juha
> Date: 2008-09-29 18:09:18 +0000 (Mon, 29 Sep 2008)
> New Revision: 27985
>
> Modified:
> xfcalendar/trunk/configure.in.in
> xfcalendar/trunk/src/parameters.c
> Log:
> Orage 4.5.14.6
> Find default timezone from operating system.
Wooh, that's nice!
> +void init_default_timezone()
> +{
> + gsize len;
> +
> + g_free(g_par.local_timezone);
> + if (g_file_get_contents("/etc/timezone", &g_par.local_timezone
> + , &len, NULL)) {
> + /* success! let's check it */
> + if (len > 2) /* get rid of the \n at the end */
> + g_par.local_timezone[len-1] = 0;
> + if (!xfical_set_local_timezone()) { /* test that ical knows it */
> + g_free(g_par.local_timezone);
> + g_par.local_timezone = NULL;
> + }
> + }
> + if (!ORAGE_STR_EXISTS(g_par.local_timezone))
> + g_par.local_timezone = g_strdup("floating");
> +}
> +
I'm not sure all distrib put timezone informations in /etc/timezone.
That's the case on Debian (and derivative I guess) but (I'll check
later) not on Fedora/Red-Hat and maybe other. Not talking about BSD
stuff.
Cheers,
--
Yves-Alexis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20080930/fbeaa506/attachment.pgp>
More information about the Xfce4-dev
mailing list