summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-14 11:04:16 +0100
committerGitHub <noreply@github.com>2021-02-14 11:04:16 +0100
commitff9cd8d3740bab51521aacd6943cea207b457ad7 (patch)
treee1c2be7ede5ab5a1aca466f3fe192750f30622b7
parentdb9ad80b63201a83663d1324acfc611b9277ecc2 (diff)
parent4db47eb32e550fb1f2d8967907b66b2d41f09050 (diff)
Merge pull request #45968 from KoBeWi/do_not_SAVE
Don't save project settings when not necessary
-rw-r--r--core/object/script_language.cpp8
-rw-r--r--editor/editor_data.cpp8
2 files changed, 16 insertions, 0 deletions
diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp
index d0636e8b84..42fb0a0caf 100644
--- a/core/object/script_language.cpp
+++ b/core/object/script_language.cpp
@@ -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");
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp
index 18364dc32f..213c3f5631 100644
--- a/editor/editor_data.cpp
+++ b/editor/editor_data.cpp
@@ -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");