aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/pcs')
-rw-r--r--calendar/pcs/cal-backend-imc.c21
1 files changed, 21 insertions, 0 deletions
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;