aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2019-05-01 16:49:27 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2019-05-01 16:49:27 +0200
commit0f92c27e65e912fdd0cde24c64bbb33e633c7454 (patch)
treee9b980ab12801d5a5c688ad61836c162e2d59672
parentRemove trailintg newline from parsed displayname files. (diff)
downloadcalp-0f92c27e65e912fdd0cde24c64bbb33e633c7454.tar.gz
calp-0f92c27e65e912fdd0cde24c64bbb33e633c7454.tar.xz
X-WR-CALNAME and COLOR attr in VCALENDAR now respected.
-rw-r--r--module/vcomponent.scm22
1 files changed, 16 insertions, 6 deletions
diff --git a/module/vcomponent.scm b/module/vcomponent.scm
index c6fe2104..e052f97e 100644
--- a/module/vcomponent.scm
+++ b/module/vcomponent.scm
@@ -159,9 +159,15 @@
;; TODO the other VCALENDAR components might not get thrown away,
;; this since I protect them from the GC in the C code.
((vdir)
- (let ((accum (make-vcomponent)))
+ (let ((accum (make-vcomponent))
+ (ch (children root)))
(set! (type accum) "VCALENDAR")
- (for cal in (children root)
+
+ (unless (null? ch)
+ (for key in (attributes (car ch))
+ (set! (attr accum key) (attr (car ch) key))))
+
+ (for cal in ch
(for component in (children cal)
(case (type component)
((VTIMEZONE)
@@ -180,10 +186,14 @@
(parse-dates! component)
- (set! (attr component "NAME")
- (attr root "NAME"))
- (set! (attr component "COLOR")
- (attr root "COLOR"))
+ (unless (attr component "NAME")
+ (set! (attr component "NAME")
+ (or (attr component "X-WR-CALNAME")
+ (attr root "NAME"))))
+
+ (unless (attr component "COLOR")
+ (set! (attr component "COLOR")
+ (attr root "COLOR")))
;; return
component)))