diff options
author | Milan Crha <mcrha@redhat.com> | 2009-12-10 23:08:52 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-12-10 23:08:52 +0800 |
commit | 4a9bf4dffd98346f9eee848708df573df56ed1d6 (patch) | |
tree | ff25e44e04c981f030fdbd734520dd6f0c9703cd /calendar/gui/comp-util.c | |
parent | 23b4037df07370ee9f2bf069db2256620c0a2f82 (diff) | |
download | gsoc2013-evolution-4a9bf4dffd98346f9eee848708df573df56ed1d6.tar.gz gsoc2013-evolution-4a9bf4dffd98346f9eee848708df573df56ed1d6.tar.zst gsoc2013-evolution-4a9bf4dffd98346f9eee848708df573df56ed1d6.zip |
Bug #499322 - Use extension for "Save as" suggested file name
Diffstat (limited to 'calendar/gui/comp-util.c')
-rw-r--r-- | calendar/gui/comp-util.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index a745b61e12..c5254a427f 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -860,3 +860,22 @@ comp_util_sanitize_recurrence_master (ECalComponent *comp, ECal *client) g_object_unref (master); } + +gchar * +icalcomp_suggest_filename (icalcomponent *icalcomp, const gchar *default_name) +{ + icalproperty *prop; + const gchar *summary = NULL; + + if (!icalcomp) + return g_strconcat (default_name, ".ics", NULL); + + prop = icalcomponent_get_first_property (icalcomp, ICAL_SUMMARY_PROPERTY); + if (prop) + summary = icalproperty_get_summary (prop); + + if (!summary || !*summary) + summary = default_name; + + return g_strconcat (summary, ".ics", NULL); +} |