deleting pointers to incomplete types may cause undefined behavior
[ardour.git] / gtk2_ardour / gui_object.cc
index 84c9fe7c673088e6a847c372c6756fa42d557c03..b00cd5ae5484c445f4ce19780d3ea4efff0eba02 100644 (file)
@@ -38,6 +38,7 @@ GUIObjectState::get_node (const XMLNode* parent, const string& id)
 {
        XMLNodeList const & children = parent->children ();
        for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
+
                if ((*i)->name() != X_("Object")) {
                        continue;
                }
@@ -70,6 +71,16 @@ GUIObjectState::get_or_add_node (const string& id)
        return get_or_add_node (&_state, id);
 }
 
+/** Remove node with provided id.
+ *  @param id property of Object node to look for.
+ */
+
+void
+GUIObjectState::remove_node (const std::string& id)
+{
+       _state.remove_nodes_and_delete(X_("id"), id );
+}
+
 /** Get a string from our state.
  *  @param id property of Object node to look for.
  *  @param prop_name name of the Object property to return.
@@ -81,6 +92,7 @@ string
 GUIObjectState::get_string (const string& id, const string& prop_name, bool* empty)
 {
        XMLNode* child = get_node (&_state, id);
+
        if (!child) {
                if (empty) {
                        *empty = true;
@@ -126,13 +138,6 @@ GUIObjectState::load (const XMLNode& node)
        (void) set_state (node);
 }
 
-GUIObjectState&
-GUIObjectState::operator= (const GUIObjectState& other)
-{
-       _state = other._state;
-       return *this;
-}
-
 std::list<string>
 GUIObjectState::all_ids () const
 {