diff options
Diffstat (limited to 'libs/ardour/io.cc')
-rw-r--r-- | libs/ardour/io.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libs/ardour/io.cc b/libs/ardour/io.cc index 4f1b03dfda..23c7594d40 100644 --- a/libs/ardour/io.cc +++ b/libs/ardour/io.cc @@ -1478,10 +1478,14 @@ IO::name_from_state (const XMLNode& node) void IO::set_name_in_state (XMLNode& node, const string& new_name) { - const XMLProperty* prop; - - if ((prop = node.property ("name")) != 0) { - node.add_property ("name", new_name); + node.add_property (X_("name"), new_name); + XMLNodeList children = node.children (); + for (XMLNodeIterator i = children.begin(); i != children.end(); ++i) { + if ((*i)->name() == X_("Port")) { + string const old_name = (*i)->property(X_("name"))->value(); + string const old_name_second_part = old_name.substr (old_name.find_first_of ("/") + 1); + (*i)->add_property (X_("name"), string_compose ("%1/%2", new_name, old_name_second_part)); + } } } |