aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2004-02-06 10:47:44 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-02-06 10:47:44 +0800
commitf50cbd6b5ec4ab3616e693e83ececd617f559521 (patch)
treecd344e372f9adad7804237534d8dc2ed8e6bc461 /calendar/gui
parentfdd316cd244fd667ac4c4620ae028668e87a3097 (diff)
downloadgsoc2013-evolution-f50cbd6b5ec4ab3616e693e83ececd617f559521.tar.gz
gsoc2013-evolution-f50cbd6b5ec4ab3616e693e83ececd617f559521.tar.zst
gsoc2013-evolution-f50cbd6b5ec4ab3616e693e83ececd617f559521.zip
add proto
004-02-05 JP Rosevear <jpr@ximian.com> * gui/calendar-config.h: add proto * gui/calendar-config.c (calendar_config_get_icaltimezone): return the icaltimezone based on the location and default to utc if we can't find one (calendar_config_get_hide_completed_tasks_sexp): use above svn path=/trunk/; revision=24641
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/calendar-config.c24
-rw-r--r--calendar/gui/calendar-config.h1
2 files changed, 20 insertions, 5 deletions
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c
index 55317a4bd3..9280996d4a 100644
--- a/calendar/gui/calendar-config.c
+++ b/calendar/gui/calendar-config.c
@@ -171,12 +171,27 @@ calendar_config_add_notification_primary_calendar (GConfClientNotifyFunc func, g
you should assume UTC (though Evolution will show the timezone-setting
dialog the next time a calendar or task folder is selected). */
gchar *
-calendar_config_get_timezone (void)
+calendar_config_get_timezone (void)
{
- /* FIXME Guard against NULL? */
return gconf_client_get_string (config, CALENDAR_CONFIG_TIMEZONE, NULL);
}
+icaltimezone *
+calendar_config_get_icaltimezone (void)
+{
+ char *location;
+ icaltimezone *zone = NULL;
+
+ location = calendar_config_get_timezone ();
+ if (location)
+ zone = icaltimezone_get_builtin_timezone (location);
+
+ if (!zone)
+ zone = icaltimezone_get_utc_timezone ();
+
+ return zone;
+}
+
/* Sets the timezone. If set to NULL it defaults to UTC.
FIXME: Should check it is being set to a valid timezone. */
@@ -988,15 +1003,14 @@ calendar_config_get_hide_completed_tasks_sexp (void)
immediately, so we filter out all completed tasks.*/
sexp = g_strdup ("(not is-completed?)");
} else {
- char *location, *isodate;
+ char *isodate;
icaltimezone *zone;
struct icaltimetype tt;
time_t t;
/* Get the current time, and subtract the appropriate
number of days/hours/minutes. */
- location = calendar_config_get_timezone ();
- zone = icaltimezone_get_builtin_timezone (location);
+ zone = calendar_config_get_icaltimezone ();
tt = icaltime_current_time_with_zone (zone);
switch (units) {
diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h
index ac9affce00..847cba98ef 100644
--- a/calendar/gui/calendar-config.h
+++ b/calendar/gui/calendar-config.h
@@ -80,6 +80,7 @@ guint calendar_config_add_notification_primary_calendar (GConfClientNotifyFunc
/* The current timezone, e.g. "Europe/London". */
gchar* calendar_config_get_timezone (void);
+icaltimezone *calendar_config_get_icaltimezone (void);
void calendar_config_set_timezone (gchar *timezone);
guint calendar_config_add_notification_timezone (GConfClientNotifyFunc func, gpointer data);