mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Auto-load a new "saved reports" config file.
* src/scm/paths.scm: create gnc:current-saved-reports, as the file to store saved reports from cstim. Autoload the saved-reports file at startup (after config.user/config.auto is loaded). * src/scm/main.scm: export gnc:current-saved-reports git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@10066 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
2f265559ed
commit
2b072e23c8
@ -1,3 +1,11 @@
|
||||
2004-06-18 Derek Atkins <derek@ihtfp.com>
|
||||
|
||||
* src/scm/paths.scm: create gnc:current-saved-reports, as
|
||||
the file to store saved reports from cstim. Autoload the
|
||||
saved-reports file at startup (after config.user/config.auto
|
||||
is loaded).
|
||||
* src/scm/main.scm: export gnc:current-saved-reports
|
||||
|
||||
2004-05-29 Derek Atkins <derek@ihtfp.com>
|
||||
|
||||
* src/engine/Transaction.c:
|
||||
|
@ -61,6 +61,7 @@
|
||||
;; from path.scm
|
||||
(export gnc:make-home-dir)
|
||||
(export gnc:current-config-auto)
|
||||
(export gnc:current-saved-reports)
|
||||
|
||||
;; from command-line.scm
|
||||
(export gnc:*config-path*)
|
||||
|
@ -42,21 +42,30 @@
|
||||
(define gnc:current-config-auto
|
||||
(build-path (getenv "HOME") ".gnucash" "config-1.8.auto"))
|
||||
|
||||
(define gnc:current-saved-reports
|
||||
(build-path (getenv "HOME") ".gnucash" "saved-reports-1.8"))
|
||||
|
||||
(define gnc:load-user-config-if-needed
|
||||
(let ((user-config-loaded? #f))
|
||||
|
||||
(define (try-load file-suffix)
|
||||
(define (try-load-no-set file-suffix)
|
||||
(let ((file (build-path (getenv "HOME") ".gnucash" file-suffix)))
|
||||
(gnc:debug "trying to load " file)
|
||||
(if (access? file F_OK)
|
||||
(if (false-if-exception (primitive-load file))
|
||||
(begin
|
||||
(set! user-config-loaded? #t)
|
||||
#t)
|
||||
#t
|
||||
(begin
|
||||
(gnc:warn "failure loading " file)
|
||||
#f))
|
||||
#f)))
|
||||
|
||||
(define (try-load file-suffix)
|
||||
(if (try-load-no-set file-suffix)
|
||||
(begin
|
||||
(set! user-config-loaded? #t)
|
||||
#t)
|
||||
#f))
|
||||
|
||||
(lambda ()
|
||||
(if (not user-config-loaded?)
|
||||
(begin
|
||||
@ -66,7 +75,11 @@
|
||||
;; rolls around bump the 1.4 (unnumbered) files
|
||||
;; off the list.
|
||||
'("config-1.8.user" "config-1.6.user" "config.user"
|
||||
"config-1.8.auto" "config-1.6.auto" "config.auto")))))))
|
||||
"config-1.8.auto" "config-1.6.auto" "config.auto"))
|
||||
(gnc:debug "loading saved reports")
|
||||
(or-map try-load-no-set
|
||||
'("saved-reports-1.8"))
|
||||
)))))
|
||||
|
||||
;; the system config should probably be loaded from some directory
|
||||
;; that wouldn't be a site wide mounted directory, like /usr/share
|
||||
|
Loading…
Reference in New Issue
Block a user