mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 16:46:35 +01:00
Clean template dir before overwriting existing template
This commit is contained in:
parent
d5464b39db
commit
4207b67b73
1 changed files with 9 additions and 4 deletions
|
|
@ -3164,11 +3164,16 @@ Session::save_template (const string& template_name, const string& description,
|
||||||
template_dir_path = template_name;
|
template_dir_path = template_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!replace_existing && Glib::file_test (template_dir_path, Glib::FILE_TEST_EXISTS)) {
|
if (Glib::file_test (template_dir_path, Glib::FILE_TEST_EXISTS)) {
|
||||||
|
if (replace_existing) {
|
||||||
|
/* clean out old plugin state, etc */
|
||||||
|
remove_directory (template_dir_path);
|
||||||
|
} else {
|
||||||
warning << string_compose(_("Template \"%1\" already exists - new version not created"),
|
warning << string_compose(_("Template \"%1\" already exists - new version not created"),
|
||||||
template_dir_path) << endmsg;
|
template_dir_path) << endmsg;
|
||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (g_mkdir_with_parents (template_dir_path.c_str(), 0755) != 0) {
|
if (g_mkdir_with_parents (template_dir_path.c_str(), 0755) != 0) {
|
||||||
error << string_compose(_("Could not create directory for Session template\"%1\" (%2)"),
|
error << string_compose(_("Could not create directory for Session template\"%1\" (%2)"),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue