From 8601ab0fe6c5782cc38de48576eb2f7c4fb2ccef Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 23 Apr 2012 02:26:46 +0000 Subject: Fire signal and update GUI correctly when renaming ports. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4251 a436a847-0d15-0410-975c-d299462d15a1 --- src/client/PortModel.cpp | 1 + src/gui/RenameWindow.cpp | 3 ++- src/shared/ResourceImpl.cpp | 6 ++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index 2e503100..7647e071 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -29,6 +29,7 @@ PortModel::on_property(const Raul::URI& uri, const Raul::Atom& value) } else if (uri == _uris.ingen_activity) { signal_activity().emit(value); } + ObjectModel::on_property(uri, value); } bool diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp index ffda6dd4..3584c12e 100644 --- a/src/gui/RenameWindow.cpp +++ b/src/gui/RenameWindow.cpp @@ -86,7 +86,8 @@ RenameWindow::values_changed() } else if (!Path::is_valid_name(symbol)) { _message_label->set_text("Symbol contains invalid characters"); _ok_button->property_sensitive() = false; - } else if (_app->store()->object(_object->parent()->path().child(symbol))) { + } else if (_object->symbol() != symbol && + _app->store()->object(_object->parent()->path().child(symbol))) { _message_label->set_text("An object already exists with that path"); _ok_button->property_sensitive() = false; } else if (label.empty()) { diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp index 95f2031a..2a2ceb96 100644 --- a/src/shared/ResourceImpl.cpp +++ b/src/shared/ResourceImpl.cpp @@ -34,9 +34,11 @@ ResourceImpl::add_property(const Raul::URI& uri, // Ignore duplicate statements typedef Resource::Properties::const_iterator iterator; const std::pair range = _properties.equal_range(uri); - for (iterator i = range.first; i != range.second && i != _properties.end(); ++i) - if (i->second == value && i->second.context() == ctx) + for (iterator i = range.first; i != range.second && i != _properties.end(); ++i) { + if (i->second == value && i->second.context() == ctx) { return; + } + } const Raul::Atom& v = _properties.insert(make_pair(uri, Property(value, ctx)))->second; on_property(uri, v); -- cgit v1.2.1