aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/importers
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2003-04-02 00:06:15 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2003-04-02 00:06:15 +0800
commitb8d68c6688de833d72742a6239e57c3970ab7114 (patch)
treed26cfcefedfb78ed1196153440cb3f20c40fc440 /calendar/importers
parent9ba2e2d4613f0874ab95cc635139f4ffd090bb24 (diff)
downloadgsoc2013-evolution-b8d68c6688de833d72742a6239e57c3970ab7114.tar.gz
gsoc2013-evolution-b8d68c6688de833d72742a6239e57c3970ab7114.tar.zst
gsoc2013-evolution-b8d68c6688de833d72742a6239e57c3970ab7114.zip
added filename (tasks.ics/calendar.ics) to the URI if it does not contain
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. svn path=/trunk/; revision=20611
Diffstat (limited to 'calendar/importers')
-rw-r--r--calendar/importers/icalendar-importer.c26
1 files changed, 24 insertions, 2 deletions
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;