From ed38cb9a4cddab81b72540fccf5c31d90a187834 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 23 Mar 2020 19:16:06 +0100 Subject: Actually use X-WR-CALNAME. --- module/vcomponent/parse.scm | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'module/vcomponent') diff --git a/module/vcomponent/parse.scm b/module/vcomponent/parse.scm index 11aa8dec..8efa9e62 100644 --- a/module/vcomponent/parse.scm +++ b/module/vcomponent/parse.scm @@ -308,7 +308,7 @@ row ~a column ~a ctx = ~a (name (catch 'system-error (lambda () (call-with-input-file (/ path "displayname") read-line)) - (const (basename path "/"))))) + (const #f)))) (reduce (lambda (item calendar) @@ -369,25 +369,25 @@ row ~a column ~a ctx = ~a (define-public (parse-cal-path path) (define st (stat path)) (define cal - (case (stat:type st) - [(regular) - (let ((comp (call-with-input-file path parse-calendar))) - (set! (attr comp 'X-HNH-SOURCETYPE) "file") - comp) ] - [(directory) - (report-time! "Parsing ~a" path) - (let ((comp (parse-vdir path))) - (set! (attr comp 'X-HNH-SOURCETYPE) "vdir") - comp)] - [(block-special char-special fifo socket unknown symlink) - => (lambda (t) (error "Can't parse file of type " t))])) - - (unless (attr cal "NAME") - (set! (attr cal "NAME") - (or (attr cal "X-WR-CALNAME") - "[NAMELESS]"))) - - cal + (case (stat:type st) + [(regular) + (let ((comp (call-with-input-file path parse-calendar))) + (set! (attr comp 'X-HNH-SOURCETYPE) "file") + comp) ] + [(directory) + (report-time! "Parsing ~a" path) + (let ((comp (parse-vdir path))) + (set! (attr comp 'X-HNH-SOURCETYPE) "vdir") + comp)] + [(block-special char-special fifo socket unknown symlink) + => (lambda (t) (error "Can't parse file of type " t))])) + + (unless (attr cal "NAME") + (set! (attr cal "NAME") + (or (attr cal "X-WR-CALNAME") + (string-append "[" (basename path) "]")))) + + cal ) -- cgit v1.2.3