mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 13:12:42 +00:00
Ignore trailing slashes in new project’s path when disabling Create Folder
In the “Create New Project” dialog, disabling the “Create Folder” slider with a trailing slash in the project path would cause it to incorrectly identify the last path component as the substring following the slash, in other words, an empty string. By first discarding any trailing slashes when disabling the slider, the project dialog will now identify and pop the last path component as usual even when a trailing slash is present.
This commit is contained in:
parent
b97110cd30
commit
5583ac5218
@ -315,6 +315,8 @@ void ProjectDialog::_create_dir_toggled(bool p_pressed) {
|
||||
target_path = target_path.path_join(last_custom_target_dir);
|
||||
}
|
||||
} else {
|
||||
// Strip any trailing slash.
|
||||
target_path = target_path.rstrip("/\\");
|
||||
// Save and remove target dir name.
|
||||
if (target_path.get_file() == auto_dir) {
|
||||
last_custom_target_dir = "";
|
||||
|
Loading…
Reference in New Issue
Block a user