projects
/
ardour.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h
[ardour.git]
/
libs
/
pbd
/
stateful.cc
diff --git
a/libs/pbd/stateful.cc
b/libs/pbd/stateful.cc
index 628594891bbb87de105bc646fad081072715de60..8b8219f7e2243306f201f95257b035ec20b18cf0 100644
(file)
--- a/
libs/pbd/stateful.cc
+++ b/
libs/pbd/stateful.cc
@@
-35,7
+35,7
@@
#include "pbd/xml++.h"
#include "pbd/error.h"
#include "pbd/xml++.h"
#include "pbd/error.h"
-#include "i18n.h"
+#include "
pbd/
i18n.h"
using namespace std;
using namespace std;
@@
-44,9
+44,7
@@
namespace PBD {
int Stateful::current_state_version = 0;
int Stateful::loading_state_version = 0;
int Stateful::current_state_version = 0;
int Stateful::loading_state_version = 0;
-static void do_not_delete (void*) { }
-
-Glib::Threads::Private<bool> Stateful::regenerate_xml_or_string_ids (do_not_delete);
+Glib::Threads::Private<bool> Stateful::_regenerate_xml_or_string_ids;
Stateful::Stateful ()
: _extra_xml (0)
Stateful::Stateful ()
: _extra_xml (0)
@@
-385,8
+383,9
@@
bool
Stateful::set_id (const XMLNode& node)
{
const XMLProperty* prop;
Stateful::set_id (const XMLNode& node)
{
const XMLProperty* prop;
+ bool* regen = _regenerate_xml_or_string_ids.get();
- if (regen
erate_xml_or_string_ids.get()
) {
+ if (regen
&& *regen
) {
reset_id ();
return true;
}
reset_id ();
return true;
}
@@
-408,17
+407,31
@@
Stateful::reset_id ()
void
Stateful::set_id (const string& str)
{
void
Stateful::set_id (const string& str)
{
- if (regenerate_xml_or_string_ids.get()) {
+ bool* regen = _regenerate_xml_or_string_ids.get();
+
+ if (regen && *regen) {
reset_id ();
} else {
_id = str;
}
}
reset_id ();
} else {
_id = 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)
{
void
Stateful::set_regenerate_xml_and_string_ids_in_this_thread (bool yn)
{
- regenerate_xml_or_string_ids.set (&yn);
+ bool* val = new bool (yn);
+ _regenerate_xml_or_string_ids.set (val);
}
} // namespace PBD
}
} // namespace PBD