aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog2
-rw-r--r--calendar/pcs/cal-backend-imc.c21
2 files changed, 23 insertions, 0 deletions
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 <clahey@helixcode.com>
+ * 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;