Merge pull request #99310 from syntaxerror247/filedialog_issue

Android: Set default ACCESS_FILESYSTEM root
This commit is contained in:
Thaddeus Crews 2024-12-03 14:41:03 -06:00
commit 6472e9e961
No known key found for this signature in database
GPG key ID: 62181B86FE9E5D84

View file

@ -1114,9 +1114,16 @@ void FileDialog::set_access(Access p_access) {
if (access == p_access) {
return;
}
access = p_access;
root_prefix = "";
root_subfolder = "";
switch (p_access) {
case ACCESS_FILESYSTEM: {
dir_access = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
#ifdef ANDROID_ENABLED
set_root_subfolder(OS::get_singleton()->get_system_dir(OS::SYSTEM_DIR_DESKTOP));
#endif
} break;
case ACCESS_RESOURCES: {
dir_access = DirAccess::create(DirAccess::ACCESS_RESOURCES);
@ -1125,9 +1132,6 @@ void FileDialog::set_access(Access p_access) {
dir_access = DirAccess::create(DirAccess::ACCESS_USERDATA);
} break;
}
access = p_access;
root_prefix = "";
root_subfolder = "";
_update_drives();
invalidate();
update_filters();