You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Refactor editor paths validation in EditorPaths and EditorSettings
- EditorSettings: Ensure that `create()` makes a valid singleton. Fixes #49179, fixes #49450. - EditorPaths: Cleanup code, properly set `paths_valid`. - EditorPaths: Move more paths validation (check, mkdir) from EditorSettings for a better separation of concerns. - EditorPaths: Move EditorFileSystem creation of `.godot/imported` next to other paths.
This commit is contained in:
@@ -1934,19 +1934,6 @@ void EditorFileSystem::_reimport_thread(uint32_t p_index, ImportThreadData *p_im
|
||||
}
|
||||
|
||||
void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
|
||||
{
|
||||
// Ensure that ProjectSettings::IMPORTED_FILES_PATH exists.
|
||||
DirAccess *da = DirAccess::open("res://");
|
||||
if (da->change_dir(ProjectSettings::IMPORTED_FILES_PATH) != OK) {
|
||||
Error err = da->make_dir_recursive(ProjectSettings::IMPORTED_FILES_PATH);
|
||||
if (err || da->change_dir(ProjectSettings::IMPORTED_FILES_PATH) != OK) {
|
||||
memdelete(da);
|
||||
ERR_FAIL_MSG("Failed to create '" + ProjectSettings::IMPORTED_FILES_PATH + "' folder.");
|
||||
}
|
||||
}
|
||||
memdelete(da);
|
||||
}
|
||||
|
||||
importing = true;
|
||||
EditorProgress pr("reimport", TTR("(Re)Importing Assets"), p_files.size());
|
||||
|
||||
@@ -2177,13 +2164,9 @@ EditorFileSystem::EditorFileSystem() {
|
||||
scanning_changes = false;
|
||||
scanning_changes_done = false;
|
||||
|
||||
DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
||||
if (da->change_dir(ProjectSettings::IMPORTED_FILES_PATH) != OK) {
|
||||
da->make_dir(ProjectSettings::IMPORTED_FILES_PATH);
|
||||
}
|
||||
// This should probably also work on Unix and use the string it returns for FAT32 or exFAT
|
||||
DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
|
||||
using_fat32_or_exfat = (da->get_filesystem_type() == "FAT32" || da->get_filesystem_type() == "exFAT");
|
||||
memdelete(da);
|
||||
|
||||
scan_total = 0;
|
||||
update_script_classes_queued.clear();
|
||||
|
||||
Reference in New Issue
Block a user