Merge pull request #58839 from KoBeWi/access_creator

Improve some DirAccess usage
This commit is contained in:
Rémi Verschelde 2022-03-06 22:45:07 +01:00 committed by GitHub
commit 78ad01cae7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -542,7 +542,7 @@ void EditorExportPlatform::_edit_filter_list(Set<String> &r_list, const String &
filters.push_back(f); filters.push_back(f);
} }
DirAccess *da = DirAccess::open("res://"); DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
ERR_FAIL_NULL(da); ERR_FAIL_NULL(da);
_edit_files_with_filter(da, filters, r_list, exclude); _edit_files_with_filter(da, filters, r_list, exclude);
memdelete(da); memdelete(da);

View file

@ -645,7 +645,7 @@ Error ExportTemplateManager::install_android_template_from_file(const String &p_
// To support custom Android builds, we install the Java source code and buildsystem // To support custom Android builds, we install the Java source code and buildsystem
// from android_source.zip to the project's res://android folder. // from android_source.zip to the project's res://android folder.
DirAccessRef da = DirAccess::open("res://"); DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
ERR_FAIL_COND_V(!da, ERR_CANT_CREATE); ERR_FAIL_COND_V(!da, ERR_CANT_CREATE);
// Make res://android dir (if it does not exist). // Make res://android dir (if it does not exist).

View file

@ -512,7 +512,7 @@ void FileSystemDock::_navigate_to_path(const String &p_path, bool p_select_in_fa
if (target_path.ends_with("/")) { if (target_path.ends_with("/")) {
target_path = target_path.substr(0, target_path.length() - 1); target_path = target_path.substr(0, target_path.length() - 1);
} }
DirAccess *dirAccess = DirAccess::open("res://"); DirAccess *dirAccess = DirAccess::create(DirAccess::ACCESS_RESOURCES);
if (dirAccess->file_exists(p_path)) { if (dirAccess->file_exists(p_path)) {
path = target_path; path = target_path;
} else if (dirAccess->dir_exists(p_path)) { } else if (dirAccess->dir_exists(p_path)) {