From ee1abd5ada9b670791f7dd2d306bdbf9228fa439 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 24 Mar 2019 23:24:15 +0100 Subject: Add VIRTUAL vcomponents. VIRTUAL vcomponents are vcomponents created without a source. Their primiary purpose is for creating brand new events, which will later be dumped to the proper files. They can however also be used in testing for great effect. --- module/vcalendar.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'module/vcalendar.scm') diff --git a/module/vcalendar.scm b/module/vcalendar.scm index 3f7ba6ba..c978f3fc 100644 --- a/module/vcalendar.scm +++ b/module/vcalendar.scm @@ -42,7 +42,10 @@ ;; (set! (attr ev "KEY") 10) (define-public attr (make-procedure-with-setter get-attr set-attr!)) -(define-public type %vcomponent-type) +;; (define-public type %vcomponent-get-type) +(define-public type (make-procedure-with-setter + %vcomponent-get-type + %vcomponent-set-type!)) (define-public parent %vcomponent-parent) (define-public push-child! %vcomponent-push-child!) (define-public (attributes component) (map string->symbol (%vcomponent-attribute-list component))) @@ -71,7 +74,7 @@ (let* ((root (%vcomponent-make path)) (component (parse-dates! - (case (string->symbol (or (attr root "TYPE") "no-type")) + (case (string->symbol (or (attr root "X-HNH-SOURCETYPE") "no-type")) ;; == Single ICS file == ;; Remove the abstract ROOT component, ;; returning the wanted VCALENDAR component -- cgit v1.2.3