From 0a15909d5ededef244e3a6926199ba6116156a3f Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sat, 13 Jun 2020 22:56:13 +0800 Subject: [PATCH] [eguile-utilities] compact & simplify instead of symbol->string, use string directly. --- gnucash/report/eguile-utilities.scm | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gnucash/report/eguile-utilities.scm b/gnucash/report/eguile-utilities.scm index 09bb27a50e..3f78ee8884 100644 --- a/gnucash/report/eguile-utilities.scm +++ b/gnucash/report/eguile-utilities.scm @@ -78,27 +78,25 @@ ;; Then look in Gnucash' gnucash/reports/'ftype' directory. ;; If no file is found, returns just 'fname' for use in error messages. (let* ((userpath (gnc-build-userdata-path fname)) - (frelpath (string-join (list (symbol->string ftype) fname) "/")) - (syspath (gnc-build-reports-path frelpath))) - (if (access? userpath R_OK) - userpath - (if (access? syspath R_OK) - syspath - fname)))) + (syspath (gnc-build-reports-path (string-append ftype "/" fname)))) + (cond + ((access? userpath R_OK) userpath) + ((access? syspath R_OK) syspath) + (else fname)))) (define-public (find-stylesheet fname) ;; Find the stylesheet 'fname', and return its full path. ;; First look in the user's .config/gnucash directory. ;; Then look in Gnucash' gnucash/reports/stylesheets directory. ;; If no file is found, returns just 'fname' for use in error messages. - (find-internal 'stylesheets fname)) + (find-internal "stylesheets" fname)) (define-public (find-template fname) ;; Find the template 'ftype'/'fname', and return its full path. ;; First look in the user's .config/gnucash directory. ;; Then look in Gnucash' gnucash/reports/templates directory. ;; If no file is found, returns just 'fname' for use in error messages. - (find-internal 'templates fname)) + (find-internal "templates" fname)) ; Define syntax for more readable for loops (the built-in for-each requires an ; explicit lambda and has the list expression all the way at the end).