diff options
author | Suman Manjunath <msuman@src.gnome.org> | 2008-10-20 12:21:19 +0800 |
---|---|---|
committer | Suman Manjunath <msuman@src.gnome.org> | 2008-10-20 12:21:19 +0800 |
commit | dff84c06b09b4883e73758a08b3b285185c6f120 (patch) | |
tree | 04a9cee86edb569a6dad84e426f49678f1ff9076 | |
parent | 028310948a0a646b85f6d6b0621c531a5512a474 (diff) | |
download | gsoc2013-evolution-dff84c06b09b4883e73758a08b3b285185c6f120.tar.gz gsoc2013-evolution-dff84c06b09b4883e73758a08b3b285185c6f120.tar.zst gsoc2013-evolution-dff84c06b09b4883e73758a08b3b285185c6f120.zip |
Milan Crha <mcrha@redhat.com> ** Fix for bug #528816 (Disable vCalendar importer when we can parse proper iCalendar from the given file).
svn path=/trunk/; revision=36659
-rw-r--r-- | calendar/ChangeLog | 8 | ||||
-rw-r--r-- | calendar/importers/icalendar-importer.c | 34 |
2 files changed, 31 insertions, 11 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index e076ec7f43..6300ae316f 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2008-10-20 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #528816 + + * importers/icalendar-importer.c: (vcal_supported): We do not support + vCalendar importer when we can parse the iCalendar from the file, + because the latter holds more information, like timezones. + 2008-10-17 Matt Davey <mcdavey@mrao.cam.ac.uk> ** Fix for bug #556059 diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index da10434890..eb751d07a3 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -474,22 +474,34 @@ vcal_supported(EImport *ei, EImportTarget *target, EImportImporter *im) if (g_file_get_contents(filename, &contents, NULL, NULL)) { VObject *vcal; + icalcomponent *icalcomp; - /* parse the file */ - vcal = Parse_MIME (contents, strlen (contents)); - g_free (contents); + icalcomp = e_cal_util_parse_ics_string (contents); - if (vcal) { - icalcomponent *icalcomp; + if (icalcomp && icalcomponent_is_valid (icalcomp)) { + /* If we can create proper iCalendar from the file, then + rather use ics importer, because it knows to read more + information than older version, the vCalendar. */ + ret = FALSE; + g_free (contents); + } else { + if (icalcomp) + icalcomponent_free (icalcomp); - icalcomp = icalvcal_convert (vcal); + /* parse the file */ + vcal = Parse_MIME (contents, strlen (contents)); + g_free (contents); - if (icalcomp) { - icalcomponent_free (icalcomp); - ret = TRUE; - } + if (vcal) { + icalcomp = icalvcal_convert (vcal); - cleanVObject (vcal); + if (icalcomp) { + icalcomponent_free (icalcomp); + ret = TRUE; + } + + cleanVObject (vcal); + } } } g_free (filename); |