mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Implement gnc-optiondb-foreach.
This commit is contained in:
parent
81d261897e
commit
f7f2d22909
@ -832,6 +832,23 @@ wrap_unique_ptr(GncOptionDBPtr, GncOptionDB);
|
|||||||
auto option{odb->find_option(section, name)};
|
auto option{odb->find_option(section, name)};
|
||||||
option->set_ui_item_selectable(selectable);
|
option->set_ui_item_selectable(selectable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gnc_optiondb_foreach(GncOptionDBPtr& odb, SCM thunk)
|
||||||
|
{
|
||||||
|
odb->foreach_section(
|
||||||
|
[&thunk](const GncOptionSectionPtr& section)
|
||||||
|
{
|
||||||
|
section->foreach_option(
|
||||||
|
[&thunk](auto& option)
|
||||||
|
{
|
||||||
|
auto optvoidptr{reinterpret_cast<void*>(
|
||||||
|
const_cast<GncOption*>(&option))};
|
||||||
|
auto scm_opt{scm_from_pointer(optvoidptr, nullptr)};
|
||||||
|
scm_call_1(thunk, scm_opt);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
#endif //SWIGGUILE
|
#endif //SWIGGUILE
|
||||||
|
Loading…
Reference in New Issue
Block a user