Fix missing favorite files in filesystem dock

This commit is contained in:
Daniel Kříž 2022-04-06 22:38:16 +02:00
parent 9d3c8f04d4
commit cbe363d716

View file

@ -228,11 +228,12 @@ void FileSystemDock::_update_tree(const Vector<String> &p_uncollapsed_paths, boo
DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES); DirAccessRef da = DirAccess::create(DirAccess::ACCESS_RESOURCES);
bool fav_changed = false; bool fav_changed = false;
for (int i = favorite_paths.size() - 1; i >= 0; i--) { for (int i = favorite_paths.size() - 1; i >= 0; i--) {
if (!da->dir_exists(favorite_paths[i])) { if (da->dir_exists(favorite_paths[i]) || da->file_exists(favorite_paths[i])) {
continue;
}
favorite_paths.remove_at(i); favorite_paths.remove_at(i);
fav_changed = true; fav_changed = true;
} }
}
if (fav_changed) { if (fav_changed) {
EditorSettings::get_singleton()->set_favorites(favorite_paths); EditorSettings::get_singleton()->set_favorites(favorite_paths);
} }