From 4c6cdbb2adff3dcdcec59fa3da16e8b939054602 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Fri, 7 Dec 2001 15:40:06 +0000 Subject: if the key in the config database does not exist, just return the local 2001-12-07 Rodrigo Moya * gui/calendar-config.c (calendar_config_get_default_uri): (calendar_config_get_default_tasks_uri): if the key in the config database does not exist, just return the local URIs, but never return NULL svn path=/trunk/; revision=14930 --- calendar/ChangeLog | 7 +++++++ calendar/gui/calendar-config.c | 22 ++++++++++++++++++++-- 2 files changed, 27 insertions(+), 2 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index cb18f6fa87..067afc7e8a 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2001-12-07 Rodrigo Moya + + * gui/calendar-config.c (calendar_config_get_default_uri): + (calendar_config_get_default_tasks_uri): if the key in the config + database does not exist, just return the local URIs, but never + return NULL + 2001-12-06 Rodrigo Moya * gui/dialogs/event-page.c (event_page_fill_widgets): default diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index b594423446..0aee3df602 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -421,7 +421,16 @@ calendar_config_write_on_exit (void) gchar * calendar_config_get_default_uri (void) { - return config->default_uri; + static gchar *default_uri = NULL; + + if (config->default_uri) + return config->default_uri; + + if (!default_uri) + default_uri = g_strdup_printf ("%/evolution/local/Calendar/calendar.ics", + g_get_home_dir ()); + + return default_uri; } /* Sets the default calendar URI */ @@ -439,7 +448,16 @@ calendar_config_set_default_uri (gchar *default_uri) gchar * calendar_config_get_default_tasks_uri (void) { - return config->default_tasks_uri; + static gchar *default_tasks_uri = NULL; + + if (config->default_tasks_uri) + return config->default_tasks_uri; + + if (!default_tasks_uri) + default_tasks_uri = g_strdup_printf ("%/evolution/local/Tasks/tasks.ics", + g_get_home_dir ()); + + return default_tasks_uri; } void -- cgit