From a7171faa016ed5b46f57b3ee29ea39d83ed396b7 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 9 May 2000 19:47:17 +0000 Subject: Set the format when creating a new calendar. 2000-05-09 Christopher James Lahey * pcs/cal-backend-imc.c: Set the format when creating a new calendar. svn path=/trunk/; revision=2961 --- calendar/ChangeLog | 2 ++ calendar/pcs/cal-backend-imc.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 507bf06faf..3291ba4c62 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,7 @@ 2000-05-09 Christopher James Lahey + * pcs/cal-backend-imc.c: Set the format when creating a new calendar. + * pcs/cal-factory.c: Removed double free of method_string in uri->method_string. diff --git a/calendar/pcs/cal-backend-imc.c b/calendar/pcs/cal-backend-imc.c index 29c806a89f..792abbb4ae 100644 --- a/calendar/pcs/cal-backend-imc.c +++ b/calendar/pcs/cal-backend-imc.c @@ -443,6 +443,8 @@ remove_object (CalBackendIMC *cbimc, iCalObject *ico) break; default: + /* Make the compiler shut up. */ + list = NULL; g_assert_not_reached (); } @@ -777,6 +779,7 @@ cal_backend_imc_create (CalBackend *backend, GnomeVFSURI *uri) { CalBackendIMC *cbimc; IMCPrivate *priv; + char *str_uri; cbimc = CAL_BACKEND_IMC (backend); priv = cbimc->priv; @@ -793,6 +796,24 @@ cal_backend_imc_create (CalBackend *backend, GnomeVFSURI *uri) /* Done */ + /* FIXME: this looks rather bad; maybe we should check for local files + * and fail if they are remote. + */ + + str_uri = gnome_vfs_uri_to_string (uri, + (GNOME_VFS_URI_HIDE_USER_NAME + | GNOME_VFS_URI_HIDE_PASSWORD + | GNOME_VFS_URI_HIDE_HOST_NAME + | GNOME_VFS_URI_HIDE_HOST_PORT + | GNOME_VFS_URI_HIDE_TOPLEVEL_METHOD)); + + /* look at the extension on the filename and decide if this is a + * iCalendar or vCalendar file. + */ + priv->format = cal_get_type_from_filename (str_uri); + + g_free (str_uri); + gnome_vfs_uri_ref (uri); priv->uri = uri; -- cgit v1.2.3