we always only use the "C" locale when saving.

This commit is contained in:
Robin Gareus 2016-05-05 21:49:56 +02:00
parent 2624c0966b
commit 3dc7728038
33 changed files with 60 additions and 74 deletions

View file

@ -1900,7 +1900,7 @@ EngineControl::maybe_display_saved_state ()
XMLNode& XMLNode&
EngineControl::get_state () EngineControl::get_state ()
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
XMLNode* root = new XMLNode ("AudioMIDISetup"); XMLNode* root = new XMLNode ("AudioMIDISetup");
std::string path; std::string path;

View file

@ -366,7 +366,7 @@ ExportVideoDialog::apply_state (TimeSelection &tme, bool range)
float tcfps = _session->timecode_frames_per_second(); float tcfps = _session->timecode_frames_per_second();
LocaleGuard lg (X_("C")); LocaleGuard lg ();
XMLNode* node = _session->extra_xml (X_("Videotimeline")); XMLNode* node = _session->extra_xml (X_("Videotimeline"));
bool filenameset = false; bool filenameset = false;
@ -482,7 +482,7 @@ ExportVideoDialog::apply_state (TimeSelection &tme, bool range)
XMLNode& XMLNode&
ExportVideoDialog::get_state () ExportVideoDialog::get_state ()
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
XMLNode* node = new XMLNode (X_("Videoexport")); XMLNode* node = new XMLNode (X_("Videoexport"));
node->add_property (X_("ChangeGeometry"), scale_checkbox.get_active() ? X_("1") : X_("0")); node->add_property (X_("ChangeGeometry"), scale_checkbox.get_active() ? X_("1") : X_("0"));
node->add_property (X_("KeepAspect"), scale_aspect.get_active() ? X_("1") : X_("0")); node->add_property (X_("KeepAspect"), scale_aspect.get_active() ? X_("1") : X_("0"));

View file

@ -463,7 +463,7 @@ GainMeterBase::gain_activated ()
// if they use different LC_NUMERIC conventions, // if they use different LC_NUMERIC conventions,
// we will honor them. // we will honor them.
PBD::LocaleGuard lg (""); PBD::LocaleGuard lg ();
if (sscanf (gain_display.get_text().c_str(), "%f", &f) != 1) { if (sscanf (gain_display.get_text().c_str(), "%f", &f) != 1) {
return; return;
} }

View file

@ -685,7 +685,7 @@ LuaInstance::session_going_away ()
int int
LuaInstance::set_state (const XMLNode& node) LuaInstance::set_state (const XMLNode& node)
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
XMLNode* child; XMLNode* child;
if ((child = find_named_node (node, "ActionScript"))) { if ((child = find_named_node (node, "ActionScript"))) {
@ -791,7 +791,7 @@ LuaInstance::interactive_add (LuaScriptInfo::ScriptType type, int id)
XMLNode& XMLNode&
LuaInstance::get_action_state () LuaInstance::get_action_state ()
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
std::string saved; std::string saved;
{ {
luabridge::LuaRef savedstate ((*_lua_save)()); luabridge::LuaRef savedstate ((*_lua_save)());

View file

@ -308,7 +308,7 @@ int
UIConfiguration::store_color_theme () UIConfiguration::store_color_theme ()
{ {
XMLNode* root; XMLNode* root;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
root = new XMLNode("Ardour"); root = new XMLNode("Ardour");
@ -443,7 +443,7 @@ XMLNode&
UIConfiguration::get_state () UIConfiguration::get_state ()
{ {
XMLNode* root; XMLNode* root;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
root = new XMLNode("Ardour"); root = new XMLNode("Ardour");
@ -461,7 +461,7 @@ XMLNode&
UIConfiguration::get_variables (std::string which_node) UIConfiguration::get_variables (std::string which_node)
{ {
XMLNode* node; XMLNode* node;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
node = new XMLNode (which_node); node = new XMLNode (which_node);
@ -576,7 +576,7 @@ UIConfiguration::load_colors (XMLNode const & node)
void void
UIConfiguration::load_modifiers (XMLNode const & node) UIConfiguration::load_modifiers (XMLNode const & node)
{ {
PBD::LocaleGuard lg ("C"); PBD::LocaleGuard lg ();
XMLNodeList const nlist = node.children(); XMLNodeList const nlist = node.children();
XMLNodeConstIterator niter; XMLNodeConstIterator niter;
XMLProperty const *name; XMLProperty const *name;

View file

@ -85,7 +85,7 @@ VideoTimeLine::save_session ()
return; return;
} }
LocaleGuard lg (X_("C")); LocaleGuard lg ();
XMLNode* node = new XMLNode(X_("Videomonitor")); XMLNode* node = new XMLNode(X_("Videomonitor"));
if (!node) return; if (!node) return;
@ -143,7 +143,7 @@ VideoTimeLine::set_session (ARDOUR::Session *s)
if (!_session) { return ; } if (!_session) { return ; }
_session->SessionSaveUnderway.connect_same_thread (sessionsave, boost::bind (&VideoTimeLine::save_session, this)); _session->SessionSaveUnderway.connect_same_thread (sessionsave, boost::bind (&VideoTimeLine::save_session, this));
LocaleGuard lg (X_("C")); LocaleGuard lg ();
XMLNode* node = _session->extra_xml (X_("Videotimeline")); XMLNode* node = _session->extra_xml (X_("Videotimeline"));
@ -224,7 +224,7 @@ VideoTimeLine::save_undo ()
int int
VideoTimeLine::set_state (const XMLNode& node, int /*version*/) VideoTimeLine::set_state (const XMLNode& node, int /*version*/)
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
XMLProperty const * propoffset = node.property (X_("VideoOffset")); XMLProperty const * propoffset = node.property (X_("VideoOffset"));
if (propoffset) { if (propoffset) {
video_offset = atoll(propoffset->value()); video_offset = atoll(propoffset->value());
@ -237,7 +237,7 @@ XMLNode&
VideoTimeLine::get_state () VideoTimeLine::get_state ()
{ {
XMLNode* node = new XMLNode (X_("Videotimeline")); XMLNode* node = new XMLNode (X_("Videotimeline"));
LocaleGuard lg (X_("C")); LocaleGuard lg ();
node->add_property (X_("VideoOffset"), video_offset_p); node->add_property (X_("VideoOffset"), video_offset_p);
return *node; return *node;
} }

View file

@ -1895,7 +1895,7 @@ AudioDiskstream::get_state ()
{ {
XMLNode& node (Diskstream::get_state()); XMLNode& node (Diskstream::get_state());
char buf[64] = ""; char buf[64] = "";
LocaleGuard lg (X_("C")); LocaleGuard lg ();
boost::shared_ptr<ChannelList> c = channels.reader(); boost::shared_ptr<ChannelList> c = channels.reader();
snprintf (buf, sizeof(buf), "%u", (unsigned int) c->size()); snprintf (buf, sizeof(buf), "%u", (unsigned int) c->size());
@ -1937,7 +1937,7 @@ AudioDiskstream::set_state (const XMLNode& node, int version)
XMLNodeIterator niter; XMLNodeIterator niter;
uint32_t nchans = 1; uint32_t nchans = 1;
XMLNode* capture_pending_node = 0; XMLNode* capture_pending_node = 0;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
/* prevent write sources from being created */ /* prevent write sources from being created */

View file

@ -267,7 +267,7 @@ AudioTrack::set_state_part_two ()
{ {
XMLNode* fnode; XMLNode* fnode;
XMLProperty const * prop; XMLProperty const * prop;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
/* This is called after all session state has been restored but before /* This is called after all session state has been restored but before
have been made ports and connections are established. have been made ports and connections are established.

View file

@ -2053,7 +2053,7 @@ AUPlugin::parameter_is_output (uint32_t param) const
void void
AUPlugin::add_state (XMLNode* root) const AUPlugin::add_state (XMLNode* root) const
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
CFDataRef xmlData; CFDataRef xmlData;
CFPropertyListRef propertyList; CFPropertyListRef propertyList;
@ -2092,7 +2092,7 @@ AUPlugin::set_state(const XMLNode& node, int version)
{ {
int ret = -1; int ret = -1;
CFPropertyListRef propertyList; CFPropertyListRef propertyList;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
if (node.name() != state_node_name()) { if (node.name() != state_node_name()) {
error << _("Bad node sent to AUPlugin::set_state") << endmsg; error << _("Bad node sent to AUPlugin::set_state") << endmsg;

View file

@ -771,7 +771,7 @@ AudioRegion::get_basic_state ()
{ {
XMLNode& node (Region::state ()); XMLNode& node (Region::state ());
char buf[64]; char buf[64];
LocaleGuard lg (X_("C")); LocaleGuard lg ();
snprintf (buf, sizeof (buf), "%u", (uint32_t) _sources.size()); snprintf (buf, sizeof (buf), "%u", (uint32_t) _sources.size());
node.add_property ("channels", buf); node.add_property ("channels", buf);
@ -784,7 +784,7 @@ AudioRegion::state ()
{ {
XMLNode& node (get_basic_state()); XMLNode& node (get_basic_state());
XMLNode *child; XMLNode *child;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
child = node.add_child ("Envelope"); child = node.add_child ("Envelope");
@ -841,7 +841,7 @@ AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_
{ {
const XMLNodeList& nlist = node.children(); const XMLNodeList& nlist = node.children();
XMLProperty const * prop; XMLProperty const * prop;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
boost::shared_ptr<Playlist> the_playlist (_playlist.lock()); boost::shared_ptr<Playlist> the_playlist (_playlist.lock());
suspend_property_changes (); suspend_property_changes ();

View file

@ -303,7 +303,7 @@ AutomationList::state (bool full)
{ {
XMLNode* root = new XMLNode (X_("AutomationList")); XMLNode* root = new XMLNode (X_("AutomationList"));
char buf[64]; char buf[64];
LocaleGuard lg (X_("C")); LocaleGuard lg ();
root->add_property ("automation-id", EventTypeMap::instance().to_symbol(_parameter)); root->add_property ("automation-id", EventTypeMap::instance().to_symbol(_parameter));
@ -421,7 +421,7 @@ AutomationList::deserialize_events (const XMLNode& node)
int int
AutomationList::set_state (const XMLNode& node, int version) AutomationList::set_state (const XMLNode& node, int version)
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
XMLNodeList nlist = node.children(); XMLNodeList nlist = node.children();
XMLNode* nsos; XMLNode* nsos;
XMLNodeIterator niter; XMLNodeIterator niter;

View file

@ -461,7 +461,7 @@ Diskstream::get_state ()
{ {
XMLNode* node = new XMLNode ("Diskstream"); XMLNode* node = new XMLNode ("Diskstream");
char buf[64]; char buf[64];
LocaleGuard lg (X_("C")); LocaleGuard lg ();
node->add_property ("flags", enum_2_string (_flags)); node->add_property ("flags", enum_2_string (_flags));
node->add_property ("playlist", _playlist->name()); node->add_property ("playlist", _playlist->name());

View file

@ -530,7 +530,7 @@ IO::state (bool /*full_state*/)
char buf[64]; char buf[64];
string str; string str;
int n; int n;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
Glib::Threads::Mutex::Lock lm (io_lock); Glib::Threads::Mutex::Lock lm (io_lock);
node->add_property("name", _name); node->add_property("name", _name);
@ -597,7 +597,7 @@ IO::set_state (const XMLNode& node, int version)
XMLProperty const * prop; XMLProperty const * prop;
XMLNodeConstIterator iter; XMLNodeConstIterator iter;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
/* force use of non-localized representation of decimal point, /* force use of non-localized representation of decimal point,
since we use it a lot in XML files and so forth. since we use it a lot in XML files and so forth.
@ -658,7 +658,7 @@ IO::set_state_2X (const XMLNode& node, int version, bool in)
{ {
XMLProperty const * prop; XMLProperty const * prop;
XMLNodeConstIterator iter; XMLNodeConstIterator iter;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
/* force use of non-localized representation of decimal point, /* force use of non-localized representation of decimal point,
since we use it a lot in XML files and so forth. since we use it a lot in XML files and so forth.

View file

@ -348,7 +348,7 @@ LadspaPlugin::add_state (XMLNode* root) const
{ {
XMLNode *child; XMLNode *child;
char buf[32]; char buf[32];
LocaleGuard lg (X_("C")); LocaleGuard lg ();
for (uint32_t i = 0; i < parameter_count(); ++i){ for (uint32_t i = 0; i < parameter_count(); ++i){
@ -381,7 +381,7 @@ LadspaPlugin::set_state (const XMLNode& node, int version)
const char *data; const char *data;
uint32_t port_id; uint32_t port_id;
#endif #endif
LocaleGuard lg (X_("C")); LocaleGuard lg ();
if (node.name() != state_node_name()) { if (node.name() != state_node_name()) {
error << _("Bad node sent to LadspaPlugin::set_state") << endmsg; error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;
@ -431,7 +431,7 @@ LadspaPlugin::set_state_2X (const XMLNode& node, int /* version */)
const char *data; const char *data;
uint32_t port_id; uint32_t port_id;
#endif #endif
LocaleGuard lg (X_("C")); LocaleGuard lg ();
if (node.name() != state_node_name()) { if (node.name() != state_node_name()) {
error << _("Bad node sent to LadspaPlugin::set_state") << endmsg; error << _("Bad node sent to LadspaPlugin::set_state") << endmsg;

View file

@ -713,7 +713,7 @@ LuaProc::add_state (XMLNode* root) const
{ {
XMLNode* child; XMLNode* child;
char buf[32]; char buf[32];
LocaleGuard lg(X_("C")); LocaleGuard lg ();
gchar* b64 = g_base64_encode ((const guchar*)_script.c_str (), _script.size ()); gchar* b64 = g_base64_encode ((const guchar*)_script.c_str (), _script.size ());
std::string b64s (b64); std::string b64s (b64);
@ -783,7 +783,7 @@ LuaProc::set_state (const XMLNode& node, int version)
const char *port; const char *port;
uint32_t port_id; uint32_t port_id;
#endif #endif
LocaleGuard lg (X_("C")); LocaleGuard lg ();
if (_script.empty ()) { if (_script.empty ()) {
if (set_script_from_state (node)) { if (set_script_from_state (node)) {

View file

@ -1127,7 +1127,7 @@ LV2Plugin::add_state(XMLNode* root) const
XMLNode* child; XMLNode* child;
char buf[32]; char buf[32];
LocaleGuard lg(X_("C")); LocaleGuard lg ();
for (uint32_t i = 0; i < parameter_count(); ++i) { for (uint32_t i = 0; i < parameter_count(); ++i) {
if (parameter_is_input(i) && parameter_is_control(i)) { if (parameter_is_input(i) && parameter_is_control(i)) {
@ -1806,7 +1806,7 @@ LV2Plugin::set_state(const XMLNode& node, int version)
const char* sym; const char* sym;
const char* value; const char* value;
uint32_t port_id; uint32_t port_id;
LocaleGuard lg(X_("C")); LocaleGuard lg ();
if (node.name() != state_node_name()) { if (node.name() != state_node_name()) {
error << _("Bad node sent to LV2Plugin::set_state") << endmsg; error << _("Bad node sent to LV2Plugin::set_state") << endmsg;

View file

@ -1213,7 +1213,7 @@ MidiDiskstream::get_state ()
{ {
XMLNode& node (Diskstream::get_state()); XMLNode& node (Diskstream::get_state());
char buf[64]; char buf[64];
LocaleGuard lg (X_("C")); LocaleGuard lg ();
if (_write_source && _session.get_record_enabled()) { if (_write_source && _session.get_record_enabled()) {
@ -1247,7 +1247,7 @@ MidiDiskstream::set_state (const XMLNode& node, int version)
XMLNodeList nlist = node.children(); XMLNodeList nlist = node.children();
XMLNodeIterator niter; XMLNodeIterator niter;
XMLNode* capture_pending_node = 0; XMLNode* capture_pending_node = 0;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
/* prevent write sources from being created */ /* prevent write sources from being created */

View file

@ -273,7 +273,7 @@ MidiTrack::set_state_part_two ()
{ {
XMLNode* fnode; XMLNode* fnode;
XMLProperty const * prop; XMLProperty const * prop;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
/* This is called after all session state has been restored but before /* This is called after all session state has been restored but before
have been made ports and connections are established. have been made ports and connections are established.

View file

@ -226,7 +226,7 @@ MonitorProcessor::set_state (const XMLNode& node, int version)
XMLNode& XMLNode&
MonitorProcessor::state (bool full) MonitorProcessor::state (bool full)
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
XMLNode& node (Processor::state (full)); XMLNode& node (Processor::state (full));
char buf[64]; char buf[64];

View file

@ -172,7 +172,7 @@ PannerShell::set_state (const XMLNode& node, int version)
XMLNodeList nlist = node.children (); XMLNodeList nlist = node.children ();
XMLNodeConstIterator niter; XMLNodeConstIterator niter;
XMLProperty const * prop; XMLProperty const * prop;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
if ((prop = node.property (X_("bypassed"))) != 0) { if ((prop = node.property (X_("bypassed"))) != 0) {
set_bypassed (string_is_affirmative (prop->value ())); set_bypassed (string_is_affirmative (prop->value ()));

View file

@ -481,7 +481,7 @@ XMLNode &
Plugin::get_state () Plugin::get_state ()
{ {
XMLNode* root = new XMLNode (state_node_name ()); XMLNode* root = new XMLNode (state_node_name ());
LocaleGuard lg (X_("C")); LocaleGuard lg ();
root->add_property (X_("last-preset-uri"), _last_preset.uri); root->add_property (X_("last-preset-uri"), _last_preset.uri);
root->add_property (X_("last-preset-label"), _last_preset.label); root->add_property (X_("last-preset-label"), _last_preset.label);

View file

@ -172,7 +172,7 @@ XMLNode&
RCConfiguration::get_state () RCConfiguration::get_state ()
{ {
XMLNode* root; XMLNode* root;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
root = new XMLNode("Ardour"); root = new XMLNode("Ardour");
@ -193,7 +193,7 @@ XMLNode&
RCConfiguration::get_variables () RCConfiguration::get_variables ()
{ {
XMLNode* node; XMLNode* node;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
node = new XMLNode ("Config"); node = new XMLNode ("Config");

View file

@ -1158,7 +1158,7 @@ Region::state ()
XMLNode *node = new XMLNode ("Region"); XMLNode *node = new XMLNode ("Region");
char buf[64]; char buf[64];
char buf2[64]; char buf2[64];
LocaleGuard lg (X_("C")); LocaleGuard lg ();
const char* fe = NULL; const char* fe = NULL;
/* custom version of 'add_properties (*node);' /* custom version of 'add_properties (*node);'

View file

@ -3039,7 +3039,7 @@ Route::set_state (const XMLNode& node, int version)
int int
Route::set_state_2X (const XMLNode& node, int version) Route::set_state_2X (const XMLNode& node, int version)
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
XMLNodeList nlist; XMLNodeList nlist;
XMLNodeConstIterator niter; XMLNodeConstIterator niter;
XMLNode *child; XMLNode *child;

View file

@ -54,7 +54,7 @@ XMLNode&
SessionConfiguration::get_state () SessionConfiguration::get_state ()
{ {
XMLNode* root; XMLNode* root;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
root = new XMLNode ("Ardour"); root = new XMLNode ("Ardour");
root->add_child_nocopy (get_variables ()); root->add_child_nocopy (get_variables ());
@ -67,7 +67,7 @@ XMLNode&
SessionConfiguration::get_variables () SessionConfiguration::get_variables ()
{ {
XMLNode* node; XMLNode* node;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
node = new XMLNode ("Config"); node = new XMLNode ("Config");
@ -159,7 +159,7 @@ SessionConfiguration::load_state ()
XMLNode* node; XMLNode* node;
if (((node = find_named_node (root, X_("Config"))) != 0)) { if (((node = find_named_node (root, X_("Config"))) != 0)) {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
set_variables(*node); set_variables(*node);
info << _("Loaded custom session defaults.") << endmsg; info << _("Loaded custom session defaults.") << endmsg;
} else { } else {

View file

@ -1002,7 +1002,7 @@ Session::load_state (string snapshot_name)
int int
Session::load_options (const XMLNode& node) Session::load_options (const XMLNode& node)
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
config.set_variables (node); config.set_variables (node);
return 0; return 0;
} }

View file

@ -245,7 +245,7 @@ Speakers::get_state ()
{ {
XMLNode* node = new XMLNode (X_("Speakers")); XMLNode* node = new XMLNode (X_("Speakers"));
char buf[32]; char buf[32];
LocaleGuard lg (X_("C")); LocaleGuard lg ();
for (vector<Speaker>::const_iterator i = _speakers.begin(); i != _speakers.end(); ++i) { for (vector<Speaker>::const_iterator i = _speakers.begin(); i != _speakers.end(); ++i) {
XMLNode* speaker = new XMLNode (X_("Speaker")); XMLNode* speaker = new XMLNode (X_("Speaker"));
@ -269,7 +269,7 @@ Speakers::set_state (const XMLNode& node, int /*version*/)
XMLNodeConstIterator i; XMLNodeConstIterator i;
XMLProperty const * prop; XMLProperty const * prop;
double a, e, d; double a, e, d;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
int n = 0; int n = 0;
_speakers.clear (); _speakers.clear ();

View file

@ -74,7 +74,7 @@ TempoSection::TempoSection (const XMLNode& node)
{ {
XMLProperty const * prop; XMLProperty const * prop;
BBT_Time start; BBT_Time start;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
if ((prop = node.property ("start")) == 0) { if ((prop = node.property ("start")) == 0) {
error << _("TempoSection XML node has no \"start\" property") << endmsg; error << _("TempoSection XML node has no \"start\" property") << endmsg;
@ -133,7 +133,7 @@ TempoSection::get_state() const
{ {
XMLNode *root = new XMLNode (xml_state_node_name); XMLNode *root = new XMLNode (xml_state_node_name);
char buf[256]; char buf[256];
LocaleGuard lg (X_("C")); LocaleGuard lg ();
snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32, snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32,
start().bars, start().bars,
@ -196,7 +196,7 @@ MeterSection::MeterSection (const XMLNode& node)
{ {
XMLProperty const * prop; XMLProperty const * prop;
BBT_Time start; BBT_Time start;
LocaleGuard lg (X_("C")); LocaleGuard lg ();
if ((prop = node.property ("start")) == 0) { if ((prop = node.property ("start")) == 0) {
error << _("MeterSection XML node has no \"start\" property") << endmsg; error << _("MeterSection XML node has no \"start\" property") << endmsg;
@ -250,7 +250,7 @@ MeterSection::get_state() const
{ {
XMLNode *root = new XMLNode (xml_state_node_name); XMLNode *root = new XMLNode (xml_state_node_name);
char buf[256]; char buf[256];
LocaleGuard lg (X_("C")); LocaleGuard lg ();
snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32, snprintf (buf, sizeof (buf), "%" PRIu32 "|%" PRIu32 "|%" PRIu32,
start().bars, start().bars,

View file

@ -160,7 +160,7 @@ VSTPlugin::set_chunk (gchar const * data, bool single)
void void
VSTPlugin::add_state (XMLNode* root) const VSTPlugin::add_state (XMLNode* root) const
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
if (_plugin->flags & 32 /* effFlagsProgramsChunks */) { if (_plugin->flags & 32 /* effFlagsProgramsChunks */) {
@ -197,7 +197,7 @@ VSTPlugin::add_state (XMLNode* root) const
int int
VSTPlugin::set_state (const XMLNode& node, int version) VSTPlugin::set_state (const XMLNode& node, int version)
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
int ret = -1; int ret = -1;
if (node.name() != state_node_name()) { if (node.name() != state_node_name()) {

View file

@ -596,7 +596,7 @@ SVAModifier::from_string (string const & str)
string string
SVAModifier::to_string () const SVAModifier::to_string () const
{ {
PBD::LocaleGuard lg ("C"); PBD::LocaleGuard lg ();
stringstream ss; stringstream ss;
switch (type) { switch (type) {

View file

@ -107,7 +107,7 @@ XMLNode&
Controllable::get_state () Controllable::get_state ()
{ {
XMLNode* node = new XMLNode (xml_node_name); XMLNode* node = new XMLNode (xml_node_name);
LocaleGuard lg (X_("C")); LocaleGuard lg ();
char buf[64]; char buf[64];
/* Waves' "Pressure3" has a parameter called "µ-iness" /* Waves' "Pressure3" has a parameter called "µ-iness"
@ -138,7 +138,7 @@ Controllable::get_state ()
int int
Controllable::set_state (const XMLNode& node, int /*version*/) Controllable::set_state (const XMLNode& node, int /*version*/)
{ {
LocaleGuard lg (X_("C")); LocaleGuard lg ();
const XMLProperty* prop; const XMLProperty* prop;
Stateful::save_extra_xml (node); Stateful::save_extra_xml (node);

View file

@ -34,20 +34,8 @@ using namespace PBD;
* and some plugin may change either behind our back. * and some plugin may change either behind our back.
*/ */
LocaleGuard::LocaleGuard (const char*)
: old_c (0)
{
init ();
}
LocaleGuard::LocaleGuard () LocaleGuard::LocaleGuard ()
: old_c (0) : old_c (0)
{
init ();
}
void
LocaleGuard::init ()
{ {
char* actual = setlocale (LC_NUMERIC, NULL); char* actual = setlocale (LC_NUMERIC, NULL);
if (strcmp ("C", actual)) { if (strcmp ("C", actual)) {

View file

@ -29,11 +29,9 @@ namespace PBD {
struct LIBPBD_API LocaleGuard { struct LIBPBD_API LocaleGuard {
public: public:
LocaleGuard (); LocaleGuard ();
LocaleGuard (const char*); // deprecated
~LocaleGuard (); ~LocaleGuard ();
private: private:
void init ();
std::locale old_cpp; std::locale old_cpp;
char* old_c; char* old_c;
}; };