mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-09 16:24:57 +01:00
Only save modified configuration variable to user config
This allows to change default values when necessary.
This commit is contained in:
parent
4e71a78bc7
commit
52bd416845
3 changed files with 19 additions and 1 deletions
|
|
@ -43,6 +43,21 @@ ConfigVariableBase::add_to_node (XMLNode& node) const
|
|||
node.add_child_nocopy (*child);
|
||||
}
|
||||
|
||||
void
|
||||
ConfigVariableBase::add_to_node_if_modified (XMLNode& node, std::string const& dflt) const
|
||||
{
|
||||
const std::string v = get_as_string ();
|
||||
if (v == dflt) {
|
||||
DEBUG_TRACE (DEBUG::Configuration, string_compose ("Config variable '%1' used default, not saved\n", _name));
|
||||
return;
|
||||
}
|
||||
DEBUG_TRACE (DEBUG::Configuration, string_compose ("Config variable '%1' stored as [%2]\n", _name, v));
|
||||
XMLNode* child = new XMLNode ("Option");
|
||||
child->set_property ("name", _name);
|
||||
child->set_property ("value", v);
|
||||
node.add_child_nocopy (*child);
|
||||
}
|
||||
|
||||
bool
|
||||
ConfigVariableBase::set_from_node (XMLNode const & node)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue