Merge pull request #59960 from DanielKriz/fix/missing-favorites

This commit is contained in:
Rémi Verschelde 2022-04-06 23:33:02 +02:00 committed by GitHub
commit 10f5352b98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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