diff options
author | Juan Linietsky <reduzio@gmail.com> | 2019-01-21 15:23:08 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2019-01-21 18:06:14 -0300 |
commit | 6fa632b82121aff5537d627364d2f10fdeafc418 (patch) | |
tree | 892a2f4028268c3b0918b0b23716a43369725a78 /editor | |
parent | 100154a1319ef6b6772bb27612f5329204a68798 (diff) |
Add function to obtain filesystem type from DirAccess.
Change EditorFileSystem to not use directory modification times on FAT32, fixes #20946
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_file_system.cpp | 6 | ||||
-rw-r--r-- | editor/editor_file_system.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 5d8903a554..d958ecebf6 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -797,7 +797,7 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir, const bool updated_dir = false; String cd = p_dir->get_path(); - if (current_mtime != p_dir->modified_time) { + if (current_mtime != p_dir->modified_time || using_fat_32) { updated_dir = true; p_dir->modified_time = current_mtime; @@ -1809,10 +1809,14 @@ EditorFileSystem::EditorFileSystem() { if (da->change_dir("res://.import") != OK) { da->make_dir("res://.import"); } + //this should probably also work on Unix and use the string it returns for FAT32 + using_fat_32 = da->get_filesystem_type()=="FAT32"; memdelete(da); scan_total = 0; update_script_classes_queued = false; + + } EditorFileSystem::~EditorFileSystem() { diff --git a/editor/editor_file_system.h b/editor/editor_file_system.h index c18957ae99..bb892baf57 100644 --- a/editor/editor_file_system.h +++ b/editor/editor_file_system.h @@ -231,6 +231,8 @@ class EditorFileSystem : public Node { static Error _resource_import(const String &p_path); + bool using_fat_32; //workaround for projects in FAT32 filesystem (pendrives, most of the time) + protected: void _notification(int p_what); static void _bind_methods(); |