summaryrefslogtreecommitdiff
path: root/core/config
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2023-01-31 10:52:43 +0100
committerJuan Linietsky <reduzio@gmail.com>2023-01-31 11:28:21 +0100
commit79897dd5bc75bb0553a48fd36537454f5ad95764 (patch)
tree75f3f4808bd1d08644dcd52eeb5be28072b5baef /core/config
parente9de988020f3d46c3e7b4fd5a8a80724996035e0 (diff)
Restore script class cache if removed
I have no idea why anyone would do this, but this fixes it. Fixes #72154. Depends on #72444 being merged to function properly.
Diffstat (limited to 'core/config')
-rw-r--r--core/config/project_settings.cpp8
-rw-r--r--core/config/project_settings.h1
2 files changed, 7 insertions, 2 deletions
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp
index 00e74a7cce..b63fbde7a0 100644
--- a/core/config/project_settings.cpp
+++ b/core/config/project_settings.cpp
@@ -1137,7 +1137,7 @@ Array ProjectSettings::get_global_class_list() {
Ref<ConfigFile> cf;
cf.instantiate();
- if (cf->load(get_project_data_path().path_join("global_script_class_cache.cfg")) == OK) {
+ if (cf->load(get_global_class_list_path()) == OK) {
script_classes = cf->get_value("", "list");
} else {
#ifndef TOOLS_ENABLED
@@ -1148,11 +1148,15 @@ Array ProjectSettings::get_global_class_list() {
return script_classes;
}
+String ProjectSettings::get_global_class_list_path() const {
+ return get_project_data_path().path_join("global_script_class_cache.cfg");
+}
+
void ProjectSettings::store_global_class_list(const Array &p_classes) {
Ref<ConfigFile> cf;
cf.instantiate();
cf->set_value("", "list", p_classes);
- cf->save(get_project_data_path().path_join("global_script_class_cache.cfg"));
+ cf->save(get_global_class_list_path());
}
bool ProjectSettings::has_custom_feature(const String &p_feature) const {
diff --git a/core/config/project_settings.h b/core/config/project_settings.h
index d1704a7c31..70f697741f 100644
--- a/core/config/project_settings.h
+++ b/core/config/project_settings.h
@@ -143,6 +143,7 @@ public:
Variant get_setting(const String &p_setting, const Variant &p_default_value = Variant()) const;
Array get_global_class_list();
void store_global_class_list(const Array &p_classes);
+ String get_global_class_list_path() const;
bool has_setting(String p_var) const;
String localize_path(const String &p_path) const;