aboutsummaryrefslogtreecommitdiff
path: root/module/vcomponent/base.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@hornquist.se>2019-11-03 13:36:22 +0100
committerHugo Hörnquist <hugo@hornquist.se>2019-11-03 13:36:22 +0100
commit3f49d48ae608d5fb618453a8e2fa875b9d5420e2 (patch)
tree4345a25a5d14ff50711cbd9a58e8eacedc240ca4 /module/vcomponent/base.scm
parentRemove ALL c code. (diff)
downloadcalp-3f49d48ae608d5fb618453a8e2fa875b9d5420e2.tar.gz
calp-3f49d48ae608d5fb618453a8e2fa875b9d5420e2.tar.xz
Readd color parsing, fix minor bugs.
Diffstat (limited to 'module/vcomponent/base.scm')
-rw-r--r--module/vcomponent/base.scm13
1 files changed, 7 insertions, 6 deletions
diff --git a/module/vcomponent/base.scm b/module/vcomponent/base.scm
index f43f532e..86ea40e8 100644
--- a/module/vcomponent/base.scm
+++ b/module/vcomponent/base.scm
@@ -16,11 +16,12 @@
(let ((parent (primitive-make-vcomponent)))
(for-each (lambda (child) (add-child! parent child))
(read-vcalendar path))
- (if (null? (get-component-children parent))
- (set-attribute! parent 'X-HNH-SOURCETYPE "vdir")
- (set-attribute! parent 'X-HNH-SOURCETYPE
- (get-attribute-value (car (get-component-children parent))
- 'X-HNH-SOURCETYPE "vdir")))
+ (set-attribute!
+ parent 'X-HNH-SOURCETYPE
+ (if (null? (get-component-children parent))
+ "vdir"
+ (get-attribute-value (car (get-component-children parent))
+ 'X-HNH-SOURCETYPE "vdir")))
parent))
;; vline → value
@@ -72,7 +73,7 @@
(define-public parent get-component-parent)
(define-public (attributes component)
- (hash-map->list cons (get-component-attributes component)))
+ (map car (hash-map->list cons (get-component-attributes component))))
(define*-public children get-component-children)