From f0d7a30b0a4d9daeb8db95c59a5b0e836b03b31b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 18 Sep 2006 07:19:42 +0000 Subject: More store error correcting fixes. Working (sometimes...) patch refresh button. git-svn-id: http://svn.drobilla.net/lad/ingen@143 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/PatchModel.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/libs/client/PatchModel.cpp') diff --git a/src/libs/client/PatchModel.cpp b/src/libs/client/PatchModel.cpp index a8cdf4ef..1d2078c2 100644 --- a/src/libs/client/PatchModel.cpp +++ b/src/libs/client/PatchModel.cpp @@ -126,7 +126,7 @@ PatchModel::remove_node(CountedPtr nm) assert(i->second == nm); m_nodes.erase(i); removed_node_sig.emit(nm); - i->second->parent().reset(); + //i->second->parent().reset(); return; } @@ -241,11 +241,14 @@ PatchModel::add_connection(CountedPtr cm) || cm->dst_port()->parent()->parent().get() == this); CountedPtr existing = get_connection(cm->src_port_path(), cm->dst_port_path()); - assert(!existing); // Store should have handled this - m_connections.push_back(cm); - - new_connection_sig.emit(cm); + if (existing) { + assert(cm->src_port() == existing->src_port()); + assert(cm->dst_port() == existing->dst_port()); + } else { + m_connections.push_back(cm); + new_connection_sig.emit(cm); + } } @@ -291,9 +294,9 @@ PatchModel::disable() bool PatchModel::polyphonic() const { - return (!_parent) - ? (m_poly > 1) - : (m_poly > 1) && m_poly == ((PatchModel*)_parent.get())->poly() && m_poly > 1; + return (_parent) + ? (m_poly > 1) && m_poly == PtrCast(_parent)->poly() && m_poly > 1 + : (m_poly > 1); } -- cgit v1.2.1