summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorJohannes Mueller <github@johannes-mueller.org>2017-07-20 20:08:09 +0200
committerJohannes Mueller <github@johannes-mueller.org>2017-07-20 20:08:09 +0200
commitb03ee727e9e3bf10e320b4acc0e58282cbc6e74f (patch)
treed17500516d8c6db2cc6d33b622b0db3f5a828b46 /gtk2_ardour
parentadc2c756e61fb0051b53c39fe78d115493d81a47 (diff)
Don't try to rename the route template state dir if it doesn't exist
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/template_dialog.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk2_ardour/template_dialog.cc b/gtk2_ardour/template_dialog.cc
index 4b2813b7d5..c437c246aa 100644
--- a/gtk2_ardour/template_dialog.cc
+++ b/gtk2_ardour/template_dialog.cc
@@ -568,9 +568,11 @@ RouteTemplateManager::rename_template (TreeModel::iterator& item, const Glib::us
const string new_state_dir = Glib::build_filename (user_route_template_directory(), new_name);
if (adjusted) {
- if (g_rename (old_state_dir.c_str(), new_state_dir.c_str()) != 0) {
- error << string_compose (_("Could not rename state dir \"%1\" to \"%22\": %3"), old_state_dir, new_state_dir, strerror (errno)) << endmsg;
- return;
+ if (g_file_test (old_state_dir.c_str(), G_FILE_TEST_EXISTS)) {
+ if (g_rename (old_state_dir.c_str(), new_state_dir.c_str()) != 0) {
+ error << string_compose (_("Could not rename state dir \"%1\" to \"%22\": %3"), old_state_dir, new_state_dir, strerror (errno)) << endmsg;
+ return;
+ }
}
}