X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fexport_preset.cc;h=c6bae093c40ebf6fa4a5ca9938342256920d3ee5;hb=6584a89c4eb5024fe89a15acd8e4fa4697e606be;hp=093803daa6d8d0884d194b9771ba5a1ef04fdc2f;hpb=3b89d9eaa03406a5e03648f47734211f09b89d62;p=ardour.git diff --git a/libs/ardour/export_preset.cc b/libs/ardour/export_preset.cc index 093803daa6..c6bae093c4 100644 --- a/libs/ardour/export_preset.cc +++ b/libs/ardour/export_preset.cc @@ -37,7 +37,7 @@ ExportPreset::ExportPreset (string filename, Session & s) : if ((prop = root->property ("name"))) { set_name (prop->value()); } - + XMLNode * instant_xml = get_instant_xml (); if (instant_xml) { XMLNode * instant_copy = new XMLNode (*instant_xml); @@ -56,7 +56,7 @@ ExportPreset::set_name (string const & name) { _name = name; - XMLNode * node; + XMLNode * node; if ((node = global.root())) { node->add_property ("name", name); } @@ -84,7 +84,7 @@ ExportPreset::set_global_state (XMLNode & state) { delete global.root (); global.set_root (&state); - + set_id (_id.to_s()); set_name (_name); } @@ -94,7 +94,7 @@ ExportPreset::set_local_state (XMLNode & state) { delete local; local = &state; - + set_id (_id.to_s()); set_name (_name); } @@ -103,8 +103,9 @@ void ExportPreset::save (std::string const & filename) { save_instant_xml (); + if (global.root()) { - global.set_filename (filename); + global.set_filename (filename); global.write (); } } @@ -119,7 +120,7 @@ XMLNode * ExportPreset::get_instant_xml () const { XMLNode * instant_xml; - + if ((instant_xml = session.instant_xml ("ExportPresets"))) { XMLNodeList children = instant_xml->children ("ExportPreset"); for (XMLNodeList::iterator it = children.begin(); it != children.end(); ++it) { @@ -129,7 +130,7 @@ ExportPreset::get_instant_xml () const } } } - + return 0; } @@ -139,9 +140,9 @@ ExportPreset::save_instant_xml () const if (!local) { return; } /* First remove old, then add new */ - + remove_instant_xml (); - + XMLNode * instant_xml; if ((instant_xml = session.instant_xml ("ExportPresets"))) { instant_xml->add_child_copy (*local);