aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-itip-control.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2001-10-30 01:47:48 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2001-10-30 01:47:48 +0800
commitfc9020ba21008c6f4a8fe1826389747fab5c6848 (patch)
tree770375ed1a3a28db1a039afee94c200155549f88 /calendar/gui/e-itip-control.c
parent8650735ac6fc68c6465554fd2b0e3edc26d87b14 (diff)
downloadgsoc2013-evolution-fc9020ba21008c6f4a8fe1826389747fab5c6848.tar.gz
gsoc2013-evolution-fc9020ba21008c6f4a8fe1826389747fab5c6848.tar.zst
gsoc2013-evolution-fc9020ba21008c6f4a8fe1826389747fab5c6848.zip
new functions for setting and retrieving the default calendar URIs
2001-10-29 Rodrigo Moya <rodrigo@ximian.com> * gui/calendar-config.[ch] (calendar_config_get_default_uri): (calendar_config_set_default_uri): (calendar_config_get_default_tasks_uri): (calendar_config_set_default_tasks_uri): new functions for setting and retrieving the default calendar URIs * gui/e-itip-control.c (init): don't use hard-coded URI, but use the default calendar URI, as returned by calendar_config_get_default_uri (start_calendar_server): added a "gboolean tasks" parameter, so that the local tasks.ics file is used if the calendar to be started is for tasks when no default tasks URI is found in the configuration svn path=/trunk/; revision=14345
Diffstat (limited to 'calendar/gui/e-itip-control.c')
-rw-r--r--calendar/gui/e-itip-control.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c
index 3eac9366ab..04615b6852 100644
--- a/calendar/gui/e-itip-control.c
+++ b/calendar/gui/e-itip-control.c
@@ -180,21 +180,31 @@ start_calendar_server_cb (CalClient *cal_client,
}
static CalClient *
-start_calendar_server (gchar *uri)
+start_calendar_server (gchar *uri, gboolean tasks)
{
CalClient *client;
- gchar *filename;
+ char *cal_uri;
gboolean success;
client = cal_client_new ();
- /* FIX ME */
- filename = g_concat_dir_and_file (g_get_home_dir (), uri);
+ if (uri)
+ cal_uri = g_strdup (uri);
+ else {
+ if (tasks)
+ cal_uri = g_concat_dir_and_file (
+ g_get_home_dir (),
+ "evolution/local/Tasks/tasks.ics");
+ else
+ cal_uri = g_concat_dir_and_file (
+ g_get_home_dir (),
+ "evolution/local/Calendar/calendar.ics");
+ }
gtk_signal_connect (GTK_OBJECT (client), "cal_opened",
start_calendar_server_cb, &success);
- if (!cal_client_open_calendar (client, filename, FALSE))
+ if (!cal_client_open_calendar (client, cal_uri, FALSE))
return NULL;
/* run a sub event loop to turn cal-client's async load
@@ -238,10 +248,13 @@ init (EItipControl *itip)
GTK_SIGNAL_FUNC (next_clicked_cb), itip);
/* Get the cal clients */
- priv->event_client = start_calendar_server ("evolution/local/Calendar/calendar.ics");
+ priv->event_client = start_calendar_server (
+ calendar_config_get_default_uri (), FALSE);
if (priv->event_client == NULL)
g_warning ("Unable to start calendar client");
- priv->task_client = start_calendar_server ("evolution/local/Tasks/tasks.ics");
+
+ priv->task_client = start_calendar_server (
+ calendar_config_get_default_tasks_uri (), FALSE);
if (priv->task_client == NULL)
g_warning ("Unable to start calendar client");