Răsfoiți Sursa

Merge pull request #9225 from bojidar-bg/attempt-fix-fs-dock

Fix EditorFileSystem duplicating root folder in new folders
Rémi Verschelde 8 ani în urmă
părinte
comite
8a03a29233
2 a modificat fișierele cu 7 adăugiri și 2 ștergeri
  1. 7 0
      editor/editor_file_system.cpp
  2. 0 2
      editor/editor_file_system.h

+ 7 - 0
editor/editor_file_system.cpp

@@ -153,6 +153,7 @@ EditorFileSystemDirectory::EditorFileSystemDirectory() {
 
 
 	modified_time = 0;
 	modified_time = 0;
 	parent = NULL;
 	parent = NULL;
+	verified = false;
 }
 }
 
 
 EditorFileSystemDirectory::~EditorFileSystemDirectory() {
 EditorFileSystemDirectory::~EditorFileSystemDirectory() {
@@ -1040,7 +1041,10 @@ bool EditorFileSystem::_find_file(const String &p_file, EditorFileSystemDirector
 		if (idx == -1) {
 		if (idx == -1) {
 			//does not exist, create i guess?
 			//does not exist, create i guess?
 			EditorFileSystemDirectory *efsd = memnew(EditorFileSystemDirectory);
 			EditorFileSystemDirectory *efsd = memnew(EditorFileSystemDirectory);
+
 			efsd->name = path[i];
 			efsd->name = path[i];
+			efsd->parent = fs;
+
 			int idx2 = 0;
 			int idx2 = 0;
 			for (int j = 0; j < fs->get_subdir_count(); j++) {
 			for (int j = 0; j < fs->get_subdir_count(); j++) {
 
 
@@ -1421,6 +1425,7 @@ EditorFileSystem::EditorFileSystem() {
 
 
 	singleton = this;
 	singleton = this;
 	filesystem = memnew(EditorFileSystemDirectory); //like, empty
 	filesystem = memnew(EditorFileSystemDirectory); //like, empty
+	filesystem->parent = NULL;
 
 
 	thread = NULL;
 	thread = NULL;
 	scanning = false;
 	scanning = false;
@@ -1429,7 +1434,9 @@ EditorFileSystem::EditorFileSystem() {
 	thread_sources = NULL;
 	thread_sources = NULL;
 	new_filesystem = NULL;
 	new_filesystem = NULL;
 
 
+	abort_scan = false;
 	scanning_changes = false;
 	scanning_changes = false;
+	scanning_changes_done = false;
 	ResourceSaver::set_save_callback(_resource_saved);
 	ResourceSaver::set_save_callback(_resource_saved);
 
 
 	DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
 	DirAccess *da = DirAccess::create(DirAccess::ACCESS_RESOURCES);

+ 0 - 2
editor/editor_file_system.h

@@ -168,8 +168,6 @@ class EditorFileSystem : public Node {
 
 
 	void _scan_fs_changes(EditorFileSystemDirectory *p_dir, const ScanProgress &p_progress);
 	void _scan_fs_changes(EditorFileSystemDirectory *p_dir, const ScanProgress &p_progress);
 
 
-	int md_count;
-
 	Set<String> valid_extensions;
 	Set<String> valid_extensions;
 	Set<String> import_extensions;
 	Set<String> import_extensions;