diff options
author | nobody <nobody@localhost> | 2002-03-10 23:35:38 +0800 |
---|---|---|
committer | nobody <nobody@localhost> | 2002-03-10 23:35:38 +0800 |
commit | e587bc31c9428d33bd833a97a284be0d7b7b2053 (patch) | |
tree | 112fdd1c1308eff2630d6e381ed55bb0b4ee3071 /calendar/gui/alarm-notify/config-data.c | |
parent | 0bdf8fdb5529e6cda86403085c1f6870796404d3 (diff) | |
download | gsoc2013-evolution-GNOME_CONTROL_CENTER_1_99_8.tar gsoc2013-evolution-GNOME_CONTROL_CENTER_1_99_8.tar.gz gsoc2013-evolution-GNOME_CONTROL_CENTER_1_99_8.tar.bz2 gsoc2013-evolution-GNOME_CONTROL_CENTER_1_99_8.tar.lz gsoc2013-evolution-GNOME_CONTROL_CENTER_1_99_8.tar.xz gsoc2013-evolution-GNOME_CONTROL_CENTER_1_99_8.tar.zst gsoc2013-evolution-GNOME_CONTROL_CENTER_1_99_8.zip |
This commit was manufactured by cvs2svn to create tagGNOME_CONTROL_CENTER_1_99_8
'GNOME_CONTROL_CENTER_1_99_8'.
svn path=/tags/GNOME_CONTROL_CENTER_1_99_8/; revision=16045
Diffstat (limited to 'calendar/gui/alarm-notify/config-data.c')
-rw-r--r-- | calendar/gui/alarm-notify/config-data.c | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c deleted file mode 100644 index 71170a3ad6..0000000000 --- a/calendar/gui/alarm-notify/config-data.c +++ /dev/null @@ -1,112 +0,0 @@ -/* Evolution calendar - Configuration values for the alarm notification daemon - * - * Copyright (C) 2001 Ximian, Inc. - * - * Authors: Federico Mena-Quintero <federico@ximian.com> - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#include "config-data.h" -#include "save.h" - - - -/* Whether we have initied ourselves by reading the data from the configuration engine */ -static gboolean inited; - -/* Configuration values */ -static icaltimezone *local_timezone; -static gboolean use_24_hour_format; - - - -/* Copied from ../calendar-config.c; returns whether the locale has 'am' and - * 'pm' strings defined. - */ -static gboolean -locale_supports_12_hour_format (void) -{ - char s[16]; - time_t t = 0; - - strftime (s, sizeof s, "%p", gmtime (&t)); - return s[0] != '\0'; -} - -/* Ensures that the configuration values have been read */ -static void -ensure_inited (void) -{ - Bonobo_ConfigDatabase db; - char *location; - - if (inited) - return; - - inited = TRUE; - - db = get_config_db (); - if (db == CORBA_OBJECT_NIL) { - /* This sucks */ - local_timezone = icaltimezone_get_utc_timezone (); - - /* This sucks as well */ - use_24_hour_format = TRUE; - - return; - } - - location = bonobo_config_get_string_with_default (db, - "/Calendar/Display/Timezone", "UTC", NULL); - if (location && location[0]) { - local_timezone = icaltimezone_get_builtin_timezone (location); - } else { - local_timezone = icaltimezone_get_utc_timezone (); - } - g_free (location); - - if (locale_supports_12_hour_format ()) { - /* Wasn't the whole point of a configuration engine *NOT* to - * have apps specify their own stupid defaults everywhere, but - * just in a schema file? - */ - use_24_hour_format = bonobo_config_get_boolean_with_default ( - db, - "/Calendar/Display/Use24HourFormat", FALSE, NULL); - } else - use_24_hour_format = TRUE; - - discard_config_db (db); -} - -icaltimezone * -config_data_get_timezone (void) -{ - ensure_inited (); - - return local_timezone; -} - -gboolean -config_data_get_24_hour_format (void) -{ - ensure_inited (); - - return use_24_hour_format; -} |