You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Added proper resource preview cache invalidation, fixes #5342
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "editor_node.h"
|
||||
#include "io/resource_saver.h"
|
||||
#include "editor_settings.h"
|
||||
#include "editor_resource_preview.h"
|
||||
|
||||
EditorFileSystem *EditorFileSystem::singleton=NULL;
|
||||
|
||||
@@ -848,6 +849,7 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const S
|
||||
continue;
|
||||
|
||||
}
|
||||
|
||||
if (_check_meta_sources(p_dir->files[i]->meta)) {
|
||||
ItemAction ia;
|
||||
ia.action=ItemAction::ACTION_FILE_SOURCES_CHANGED;
|
||||
@@ -858,6 +860,8 @@ void EditorFileSystem::_scan_fs_changes(EditorFileSystemDirectory *p_dir,const S
|
||||
} else {
|
||||
p_dir->files[i]->meta.sources_changed=false;
|
||||
}
|
||||
|
||||
EditorResourcePreview::get_singleton()->check_for_invalidation(p_dir->get_file_path(i));
|
||||
}
|
||||
|
||||
for(int i=0;i<p_dir->subdirs.size();i++) {
|
||||
@@ -1328,6 +1332,7 @@ void EditorFileSystem::update_file(const String& p_file) {
|
||||
fs->files[cpos]->modified_time=FileAccess::get_modified_time(p_file);
|
||||
fs->files[cpos]->meta=_get_meta(p_file);
|
||||
|
||||
EditorResourcePreview::get_singleton()->call_deferred("check_for_invalidation",p_file);
|
||||
call_deferred("emit_signal","filesystem_changed"); //update later
|
||||
|
||||
}
|
||||
@@ -1341,6 +1346,8 @@ void EditorFileSystem::_bind_methods() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
EditorFileSystem::EditorFileSystem() {
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user