aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog6
-rw-r--r--calendar/importers/icalendar-importer.c26
2 files changed, 30 insertions, 2 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index b831e0020e..5007f75489 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,9 @@
+2003-04-01 Rodrigo Moya <rodrigo@ximian.com>
+
+ * importers/icalendar-importer.c (load_file_fn, vcal_load_file_fn):
+ added filename (tasks.ics/calendar.ics) to the URI if it does not
+ contain it.
+
2003-03-31 Rodrigo Moya <rodrigo@ximian.com>
Fixes #39961
diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c
index 9f336a4d05..467545a0ca 100644
--- a/calendar/importers/icalendar-importer.c
+++ b/calendar/importers/icalendar-importer.c
@@ -292,11 +292,22 @@ load_file_fn (EvolutionImporter *importer,
icalcomp = icalparser_parse_string (contents);
if (icalcomp) {
- if (cal_client_open_calendar (ici->client, physical_uri, TRUE)
+ char *real_uri;
+
+ if (!g_strncasecmp (physical_uri, "file", 4) &&
+ g_strcasecmp (physical_uri + (strlen (physical_uri) - strlen ("calendar.ics")),
+ "calendar.ics")) {
+ real_uri = g_concat_dir_and_file (physical_uri, "calendar.ics");
+ } else
+ real_uri = g_strdup (physical_uri);
+
+ if (cal_client_open_calendar (ici->client, real_uri, TRUE)
&& cal_client_open_default_tasks (ici->tasks_client, FALSE)) {
ici->icalcomp = icalcomp;
ret = TRUE;
}
+
+ g_free (real_uri);
}
}
@@ -413,11 +424,22 @@ vcal_load_file_fn (EvolutionImporter *importer,
icalcomp = load_vcalendar_file (filename);
if (icalcomp) {
- if (cal_client_open_calendar (ici->client, physical_uri, TRUE)
+ char *real_uri;
+
+ if (!g_strncasecmp (physical_uri, "file", 4) &&
+ g_strcasecmp (physical_uri + (strlen (physical_uri) - strlen ("calendar.ics")),
+ "calendar.ics")) {
+ real_uri = g_concat_dir_and_file (physical_uri, "calendar.ics");
+ } else
+ real_uri = g_strdup (physical_uri);
+
+ if (cal_client_open_calendar (ici->client, real_uri, TRUE)
&& cal_client_open_default_tasks (ici->tasks_client, FALSE)) {
ici->icalcomp = icalcomp;
ret = TRUE;
}
+
+ g_free (real_uri);
}
return ret;