mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
New scheme function gnc_option_default_value.
This commit is contained in:
parent
3f576671aa
commit
12c5b94430
@ -240,6 +240,15 @@ wrap_unique_ptr(GncOptionDBPtr, GncOptionDB);
|
||||
return GncOption_get_scm_value(&(db_opt->get()));
|
||||
}
|
||||
|
||||
SCM gnc_option_default_value(const GncOptionDBPtr& optiondb,
|
||||
const char* section, const char* name)
|
||||
{
|
||||
auto db_opt = optiondb->find_option(section, name);
|
||||
if (!db_opt)
|
||||
return SCM_BOOL_F;
|
||||
return GncOption_get_scm_default_value(&(db_opt->get()));
|
||||
}
|
||||
|
||||
void gnc_set_option(const GncOptionDBPtr& optiondb, const char* section,
|
||||
const char* name, SCM new_value)
|
||||
{
|
||||
|
@ -77,8 +77,10 @@
|
||||
(multi-opt (gnc-register-multichoice-option option-db "foo" "bar" "baz"
|
||||
"Phony Option" multichoice)))
|
||||
|
||||
(test-equal "plugh" (gnc-option-value option-db "foo" "bar"))
|
||||
(gnc-set-option option-db "foo" "bar" "corge")
|
||||
(test-equal "corge" (gnc-option-value option-db "foo" "bar")))
|
||||
(test-equal "corge" (gnc-option-value option-db "foo" "bar"))
|
||||
(test-equal "plugh" (gnc-option-default-value option-db "foo" "bar")))
|
||||
(test-end "test-gnc-test-multichoice-option"))
|
||||
|
||||
(define (test-gnc-make-list-option)
|
||||
@ -93,6 +95,7 @@
|
||||
(test-equal "AvgBalPlot" (gnc-option-value option-db "foo" "bar"))
|
||||
(gnc-set-option option-db "foo" "bar" "GLPlot")
|
||||
(test-equal "GLPlot" (gnc-option-value option-db "foo" "bar"))
|
||||
(test-equal "AvgBalPlot" (gnc-option-default-value option-db "foo" "bar")))
|
||||
(test-end "test-gnc-test-list-option"))
|
||||
|
||||
(define (test-gnc-make-date-option)
|
||||
|
Loading…
Reference in New Issue
Block a user