Swap arguments of ResourceSaver.save()

This commit is contained in:
kobewi
2022-06-03 01:33:42 +02:00
parent ba3734e69a
commit c3606cb5f3
57 changed files with 97 additions and 99 deletions

View File

@@ -867,7 +867,6 @@ void EditorSettings::create() {
}
singleton->save_changed_setting = true;
singleton->config_file_path = config_file_path;
print_verbose("EditorSettings: Load OK!");
@@ -892,8 +891,8 @@ fail:
}
singleton = Ref<EditorSettings>(memnew(EditorSettings));
singleton->set_path(config_file_path, true);
singleton->save_changed_setting = true;
singleton->config_file_path = config_file_path;
singleton->_load_defaults(extra_config);
singleton->setup_language();
singleton->setup_network();
@@ -953,15 +952,10 @@ void EditorSettings::save() {
return;
}
if (singleton->config_file_path.is_empty()) {
ERR_PRINT("Cannot save EditorSettings config, no valid path");
return;
}
Error err = ResourceSaver::save(singleton->config_file_path, singleton);
Error err = ResourceSaver::save(singleton);
if (err != OK) {
ERR_PRINT("Error saving editor settings to " + singleton->config_file_path);
ERR_PRINT("Error saving editor settings to " + singleton->get_path());
} else {
singleton->changed_settings.clear();
print_verbose("EditorSettings: Save OK!");