mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Fix file_dialog's root_subfolder on Windows
`root_prefix` either contains an empty string or the current root including the drive letter. This means that the previous logic would never ever match since `dir_access->get_current_dir(false)` explicitly excludes the drive letter. This change removes this boolean parameter so we compare paths in a way that can match. I've had a look at the implementations for other platforms for `DirAccess::get_current_dir(bool include_drive)` and outside Windows none seem to consider the `include_drive` parameter which makes me believe that this change won't break other platforms.
This commit is contained in:
parent
2b832e9974
commit
375f88d161
1 changed files with 1 additions and 1 deletions
|
|
@ -1448,7 +1448,7 @@ void FileDialog::_change_dir(const String &p_new_dir) {
|
||||||
} else {
|
} else {
|
||||||
String old_dir = dir_access->get_current_dir();
|
String old_dir = dir_access->get_current_dir();
|
||||||
dir_access->change_dir(p_new_dir);
|
dir_access->change_dir(p_new_dir);
|
||||||
if (!dir_access->get_current_dir(false).begins_with(root_prefix)) {
|
if (!dir_access->get_current_dir().begins_with(root_prefix)) {
|
||||||
dir_access->change_dir(old_dir);
|
dir_access->change_dir(old_dir);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue