summaryrefslogtreecommitdiff
path: root/tools/editor/editor_settings.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-02-12 23:20:48 +0100
committerGitHub <noreply@github.com>2017-02-12 23:20:48 +0100
commitc96fa0f23e956678d1f2f92932d700d3e3ab1022 (patch)
tree73812976ce0a8465b671f95e9e435a750e095cf2 /tools/editor/editor_settings.cpp
parent70fff42df5f1079cc5061f2a9a24c28890415b74 (diff)
parent79e8616fbb7f089d2e3033e875eeb6d396ce3e3d (diff)
Merge pull request #7757 from volzhs/save-debug-options
Save and restore debug options for each project
Diffstat (limited to 'tools/editor/editor_settings.cpp')
-rw-r--r--tools/editor/editor_settings.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp
index ebac77699a..f504bfc5af 100644
--- a/tools/editor/editor_settings.cpp
+++ b/tools/editor/editor_settings.cpp
@@ -1030,26 +1030,22 @@ void EditorSettings::set_optimize_save(bool p_optimize) {
optimize_save=p_optimize;
}
-String EditorSettings::get_last_selected_language()
-{
+Variant EditorSettings::get_project_metadata(const String& p_section, const String& p_key, Variant p_default) {
Ref<ConfigFile> cf = memnew( ConfigFile );
String path = get_project_settings_path().plus_file("project_metadata.cfg");
Error err = cf->load(path);
if (err != OK) {
- return "";
+ return p_default;
}
- Variant last_selected_language = cf->get_value("script_setup", "last_selected_language");
- if (last_selected_language.get_type() != Variant::STRING)
- return "";
- return static_cast<String>(last_selected_language);
+ return cf->get_value(p_section, p_key, p_default);
}
-void EditorSettings::set_last_selected_language(String p_language)
+void EditorSettings::set_project_metadata(const String& p_section, const String& p_key, Variant p_data)
{
Ref<ConfigFile> cf = memnew( ConfigFile );
String path = get_project_settings_path().plus_file("project_metadata.cfg");
cf->load(path);
- cf->set_value("script_setup", "last_selected_language", p_language);
+ cf->set_value(p_section, p_key, p_data);
cf->save(path);
}