summaryrefslogtreecommitdiff
path: root/editor/editor_file_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r--editor/editor_file_system.cpp32
1 files changed, 5 insertions, 27 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 69663b9ed9..a2507f3cf2 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -31,10 +31,10 @@
#include "editor_file_system.h"
#include "core/config/project_settings.h"
+#include "core/io/file_access.h"
#include "core/io/resource_importer.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
-#include "core/os/file_access.h"
#include "core/os/os.h"
#include "core/variant/variant_parser.h"
#include "editor_node.h"
@@ -1475,8 +1475,6 @@ void EditorFileSystem::update_file(const String &p_file) {
if (cpos == -1) {
// The file did not exist, it was added.
-
- late_added_files.insert(p_file); // Remember that it was added. This mean it will be scanned and imported on editor restart.
int idx = 0;
String file_name = p_file.get_file();
@@ -1526,7 +1524,7 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
Map<String, String> base_paths;
for (int i = 0; i < p_files.size(); i++) {
Ref<ConfigFile> config;
- config.instance();
+ config.instantiate();
Error err = config->load(p_files[i] + ".import");
ERR_CONTINUE(err != OK);
ERR_CONTINUE(!config->has_section_key("remap", "importer"));
@@ -1708,7 +1706,7 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName
//use existing
if (p_custom_options == nullptr) {
Ref<ConfigFile> cf;
- cf.instance();
+ cf.instantiate();
Error err = cf->load(p_file + ".import");
if (err == OK) {
if (cf->has_section("params")) {
@@ -1723,9 +1721,6 @@ void EditorFileSystem::_reimport_file(const String &p_file, const Map<StringName
}
}
}
-
- } else {
- late_added_files.insert(p_file); //imported files do not call update_file(), but just in case..
}
if (importer_name == "keep") {
@@ -1934,19 +1929,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());
@@ -2086,7 +2068,7 @@ void EditorFileSystem::_move_group_files(EditorFileSystemDirectory *efd, const S
files[i]->import_group_file = p_new_location;
Ref<ConfigFile> config;
- config.instance();
+ config.instantiate();
String path = efd->get_file_path(i) + ".import";
Error err = config->load(path);
if (err != OK) {
@@ -2177,13 +2159,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();