diff options
author | David Robillard <d@drobilla.net> | 2008-12-03 16:53:02 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-12-03 16:53:02 +0000 |
commit | d4a3ba6fc510eb60f888df6217db51c0493c6d05 (patch) | |
tree | 7654f169c1d7cd357df7b80df1430359ad810f53 /src | |
parent | 80e8afa857c321514b47d114ea67fd06729a9dff (diff) | |
download | ingen-d4a3ba6fc510eb60f888df6217db51c0493c6d05.tar.gz ingen-d4a3ba6fc510eb60f888df6217db51c0493c6d05.tar.bz2 ingen-d4a3ba6fc510eb60f888df6217db51c0493c6d05.zip |
Don't allow renaming to the same name (fix ticket #282).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1845 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/RenameWindow.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/RenameWindow.cpp b/src/gui/RenameWindow.cpp index 0b89c962..a58ec2c2 100644 --- a/src/gui/RenameWindow.cpp +++ b/src/gui/RenameWindow.cpp @@ -83,8 +83,10 @@ RenameWindow::name_changed() } else if (!Path::is_valid_name(name)) { _message_label->set_text("Name contains invalid characters"); _ok_button->property_sensitive() = false; - } else if ((App::instance().store()->object(_object->parent()->path().base() + name)) && - (name != _object->path().name())) { + } else if (name == _object->path().name()) { + _message_label->set_text(""); + _ok_button->property_sensitive() = false; + } else if ((App::instance().store()->object(_object->parent()->path().base() + name))) { _message_label->set_text("An object already exists with that name."); _ok_button->property_sensitive() = false; } else if (name.length() == 0) { |