diff options
author | Robin Gareus <robin@gareus.org> | 2015-12-17 23:18:22 +0100 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-12-17 23:18:22 +0100 |
commit | b48d87b3ea2e3e4d7e62fd7880f15dbce28c49ea (patch) | |
tree | ed391ecb4a694711298d21133dd52d9dff013a0a /libs/pbd/stateful.cc | |
parent | 91f5cd008c1538cd3afd08215e2e044c4d2f5441 (diff) |
add API to query stateful ID override mode
Diffstat (limited to 'libs/pbd/stateful.cc')
-rw-r--r-- | libs/pbd/stateful.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/libs/pbd/stateful.cc b/libs/pbd/stateful.cc index a5b583cc4d..3fb11a3a50 100644 --- a/libs/pbd/stateful.cc +++ b/libs/pbd/stateful.cc @@ -44,7 +44,7 @@ namespace PBD { int Stateful::current_state_version = 0; int Stateful::loading_state_version = 0; -Glib::Threads::Private<bool> Stateful::regenerate_xml_or_string_ids; +Glib::Threads::Private<bool> Stateful::_regenerate_xml_or_string_ids; Stateful::Stateful () : _extra_xml (0) @@ -383,7 +383,7 @@ bool Stateful::set_id (const XMLNode& node) { const XMLProperty* prop; - bool* regen = regenerate_xml_or_string_ids.get(); + bool* regen = _regenerate_xml_or_string_ids.get(); if (regen && *regen) { reset_id (); @@ -407,7 +407,7 @@ Stateful::reset_id () void Stateful::set_id (const string& str) { - bool* regen = regenerate_xml_or_string_ids.get(); + bool* regen = _regenerate_xml_or_string_ids.get(); if (regen && *regen) { reset_id (); @@ -416,11 +416,22 @@ Stateful::set_id (const string& str) } } +bool +Stateful::regenerate_xml_or_string_ids () const +{ + bool* regen = _regenerate_xml_or_string_ids.get(); + if (regen && *regen) { + return true; + } else { + return false; + } +} + void Stateful::set_regenerate_xml_and_string_ids_in_this_thread (bool yn) { bool* val = new bool (yn); - regenerate_xml_or_string_ids.set (val); + _regenerate_xml_or_string_ids.set (val); } } // namespace PBD |