1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Improve ConfigFile get_sections and get_section_keys by returning Vector<String>

This commit is contained in:
dementive
2025-04-23 23:32:05 -04:00
parent 931820d33c
commit b8e44a0000
20 changed files with 58 additions and 105 deletions

View File

@@ -2585,8 +2585,7 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector
}
if (config->has_section("params")) {
List<String> sk;
config->get_section_keys("params", &sk);
Vector<String> sk = config->get_section_keys("params");
for (const String &param : sk) {
Variant value = config->get_value("params", param);
//override with whatever is in file
@@ -2769,8 +2768,7 @@ Error EditorFileSystem::_reimport_file(const String &p_file, const HashMap<Strin
Error err = cf->load(p_file + ".import");
if (err == OK) {
if (cf->has_section("params")) {
List<String> sk;
cf->get_section_keys("params", &sk);
Vector<String> sk = cf->get_section_keys("params");
for (const String &E : sk) {
if (!params.has(E)) {
params[E] = cf->get_value("params", E);
@@ -3408,8 +3406,7 @@ void EditorFileSystem::_move_group_files(EditorFileSystemDirectory *efd, const S
config->set_value("remap", "group_file", p_new_location);
}
List<String> sk;
config->get_section_keys("params", &sk);
Vector<String> sk = config->get_section_keys("params");
for (const String &param : sk) {
//not very clean, but should work
String value = config->get_value("params", param);