Skip to content

Commit 375f88d

Browse files
committed
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.
1 parent 2b832e9 commit 375f88d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scene/gui/file_dialog.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1448,7 +1448,7 @@ void FileDialog::_change_dir(const String &p_new_dir) {
14481448
} else {
14491449
String old_dir = dir_access->get_current_dir();
14501450
dir_access->change_dir(p_new_dir);
1451-
if (!dir_access->get_current_dir(false).begins_with(root_prefix)) {
1451+
if (!dir_access->get_current_dir().begins_with(root_prefix)) {
14521452
dir_access->change_dir(old_dir);
14531453
return;
14541454
}

0 commit comments

Comments
 (0)