summaryrefslogtreecommitdiff
path: root/editor/editor_file_system.cpp
diff options
context:
space:
mode:
authorne0fhyk <fhuyakou@gmail.com>2021-09-10 08:32:29 -0700
committerne0fhyk <fhuyakou@gmail.com>2021-09-15 12:52:03 -0700
commit69f890ff11a15cc2c1aa651801a872505ab08c81 (patch)
treeba9bbb131814f460a87605d3f9fce3c578e8e06a /editor/editor_file_system.cpp
parent729461b2a455bd3b4afb26bb362863a68e98a9ee (diff)
Provide a getter for the project data directory.
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r--editor/editor_file_system.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index aa89a14725..5542d808d8 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -2147,6 +2147,10 @@ Error EditorFileSystem::_resource_import(const String &p_path) {
}
bool EditorFileSystem::_should_skip_directory(const String &p_path) {
+ if (p_path == ProjectSettings::get_singleton()->get_project_data_path()) {
+ return true;
+ }
+
if (FileAccess::exists(p_path.plus_file("project.godot"))) {
// skip if another project inside this
return true;
@@ -2212,7 +2216,7 @@ void EditorFileSystem::move_group_file(const String &p_path, const String &p_new
}
ResourceUID::ID EditorFileSystem::_resource_saver_get_resource_id_for_path(const String &p_path, bool p_generate) {
- if (!p_path.is_resource_file() || p_path.begins_with("res://.godot")) {
+ if (!p_path.is_resource_file() || p_path.begins_with(ProjectSettings::get_singleton()->get_project_data_path())) {
//saved externally (configuration file) or internal file, do not assign an ID.
return ResourceUID::INVALID_ID;
}
@@ -2270,17 +2274,18 @@ bool EditorFileSystem::_scan_extensions() {
}
}
+ String extension_list_config_file = NativeExtension::get_extension_list_config_file();
if (extensions.size()) {
if (extensions_added.size() || extensions_removed.size()) { //extensions were added or removed
- FileAccessRef f = FileAccess::open(NativeExtension::EXTENSION_LIST_CONFIG_FILE, FileAccess::WRITE);
+ FileAccessRef f = FileAccess::open(extension_list_config_file, FileAccess::WRITE);
for (const String &E : extensions) {
f->store_line(E);
}
}
} else {
- if (loaded_extensions.size() || FileAccess::exists(NativeExtension::EXTENSION_LIST_CONFIG_FILE)) { //extensions were removed
+ if (loaded_extensions.size() || FileAccess::exists(extension_list_config_file)) { //extensions were removed
DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
- da->remove(NativeExtension::EXTENSION_LIST_CONFIG_FILE);
+ da->remove(extension_list_config_file);
}
}