Merge pull request #45968 from KoBeWi/do_not_SAVE

Don't save project settings when not necessary
This commit is contained in:
Rémi Verschelde 2021-02-14 11:04:16 +01:00 committed by GitHub
commit ff9cd8d374
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -275,6 +275,14 @@ void ScriptServer::save_global_classes() {
gcarr.push_back(d);
}
Array old;
if (ProjectSettings::get_singleton()->has_setting("_global_script_classes")) {
old = ProjectSettings::get_singleton()->get("_global_script_classes");
}
if ((!old.is_empty() || gcarr.is_empty()) && gcarr.hash() == old.hash()) {
return;
}
if (gcarr.is_empty()) {
if (ProjectSettings::get_singleton()->has_setting("_global_script_classes")) {
ProjectSettings::get_singleton()->clear("_global_script_classes");

View File

@ -942,6 +942,14 @@ void EditorData::script_class_save_icon_paths() {
}
}
Dictionary old;
if (ProjectSettings::get_singleton()->has_setting("_global_script_class_icons")) {
old = ProjectSettings::get_singleton()->get("_global_script_class_icons");
}
if ((!old.is_empty() || d.is_empty()) && d.hash() == old.hash()) {
return;
}
if (d.is_empty()) {
if (ProjectSettings::get_singleton()->has_setting("_global_script_class_icons")) {
ProjectSettings::get_singleton()->clear("_global_script_class_icons");