session (s), global (filename), local (0)
{
XMLNode * root;
+ std::string str;
if ((root = global.root())) {
- XMLProperty * prop;
- if ((prop = root->property ("id"))) {
- set_id (prop->value());
+ if (root->get_property ("id", str)) {
+ set_id (str);
}
- if ((prop = root->property ("name"))) {
- set_name (prop->value());
+ if (root->get_property ("name", str)) {
+ set_name (str);
}
XMLNode * instant_xml = get_instant_xml ();
XMLNode * node;
if ((node = global.root())) {
- node->add_property ("name", name);
+ node->set_property ("name", name);
}
if (local) {
- local->add_property ("name", name);
+ local->set_property ("name", name);
}
}
void
-ExportPreset::set_id (string id)
+ExportPreset::set_id (string const & id)
{
_id = id;
XMLNode * node;
if ((node = global.root())) {
- node->add_property ("id", id);
+ node->set_property ("id", id);
}
if (local) {
- local->add_property ("id", id);
+ local->set_property ("id", id);
}
}
ExportPreset::save (std::string const & filename)
{
save_instant_xml ();
-
+
if (global.root()) {
- global.set_filename (filename);
+ global.set_filename (filename);
global.write ();
}
}
if ((instant_xml = session.instant_xml ("ExportPresets"))) {
XMLNodeList children = instant_xml->children ("ExportPreset");
for (XMLNodeList::iterator it = children.begin(); it != children.end(); ++it) {
- XMLProperty * prop;
+ XMLProperty const * prop;
if ((prop = (*it)->property ("id")) && _id == PBD::UUID(prop->value())) {
return *it;
}