diff options
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r-- | editor/editor_file_system.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index a5edcf5c22..5607bb3f17 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -1865,13 +1865,14 @@ void EditorFileSystem::_find_group_files(EditorFileSystemDirectory *efd, Map<Str } void EditorFileSystem::reimport_files(const Vector<String> &p_files) { - { //check that .import folder exists + { + // Ensure that ProjectSettings::IMPORTED_FILES_PATH exists. DirAccess *da = DirAccess::open("res://"); - if (da->change_dir(".import") != OK) { - Error err = da->make_dir(".import"); - if (err) { + 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 'res://.import' folder."); + ERR_FAIL_MSG("Failed to create '" + ProjectSettings::IMPORTED_FILES_PATH + "' folder."); } } memdelete(da); @@ -2055,8 +2056,8 @@ EditorFileSystem::EditorFileSystem() { scanning_changes_done = false; DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES); - if (da->change_dir("res://.import") != OK) { - da->make_dir("res://.import"); + 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 using_fat32_or_exfat = (da->get_filesystem_type() == "FAT32" || da->get_filesystem_type() == "exFAT"); |