From f0cc8c0d54c7da5224b9a82f3e090a8bc659830e Mon Sep 17 00:00:00 2001 From: Osyotr Date: Tue, 25 Feb 2025 21:46:35 +0300 Subject: [PATCH] config: Keep in order (#2536) --- src/common/config.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/common/config.cpp b/src/common/config.cpp index 0260d8e17..0b720c5b4 100644 --- a/src/common/config.cpp +++ b/src/common/config.cpp @@ -834,7 +834,7 @@ void load(const std::filesystem::path& path) { } void save(const std::filesystem::path& path) { - toml::value data; + toml::ordered_value data; std::error_code error; if (std::filesystem::exists(path, error)) { @@ -842,7 +842,8 @@ void save(const std::filesystem::path& path) { std::ifstream ifs; ifs.exceptions(std::ifstream::failbit | std::ifstream::badbit); ifs.open(path, std::ios_base::binary); - data = toml::parse(ifs, std::string{fmt::UTF(path.filename().u8string()).data}); + data = toml::parse( + ifs, std::string{fmt::UTF(path.filename().u8string()).data}); } catch (const std::exception& ex) { fmt::print("Exception trying to parse config file. Exception: {}\n", ex.what()); return; @@ -924,7 +925,7 @@ void save(const std::filesystem::path& path) { } void saveMainWindow(const std::filesystem::path& path) { - toml::value data; + toml::ordered_value data; std::error_code error; if (std::filesystem::exists(path, error)) { @@ -932,7 +933,8 @@ void saveMainWindow(const std::filesystem::path& path) { std::ifstream ifs; ifs.exceptions(std::ifstream::failbit | std::ifstream::badbit); ifs.open(path, std::ios_base::binary); - data = toml::parse(ifs, std::string{fmt::UTF(path.filename().u8string()).data}); + data = toml::parse( + ifs, std::string{fmt::UTF(path.filename().u8string()).data}); } catch (const std::exception& ex) { fmt::print("Exception trying to parse config file. Exception: {}\n", ex.what()); return;