From f7c0a221b8c72b87a4a25653ebd6b47994f36da1 Mon Sep 17 00:00:00 2001 From: Totto16 Date: Thu, 31 Oct 2024 01:11:39 +0100 Subject: [PATCH] fix: small fix in the case of a missing settings file --- src/manager/settings_manager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/manager/settings_manager.cpp b/src/manager/settings_manager.cpp index ff1d99ad..883655e1 100644 --- a/src/manager/settings_manager.cpp +++ b/src/manager/settings_manager.cpp @@ -14,12 +14,14 @@ SettingsManager::SettingsManager(ServiceProvider* service_provider) : m_service_ if (result.has_value()) { m_settings = result.value(); } else { - spdlog::error("unable to load settings from \"{}\": {}", detail::settings_filename, result.error()); + spdlog::warn("unable to load settings from \"{}\": {}", detail::settings_filename, result.error()); spdlog::warn("applying default settings"); m_settings = { - detail::Settings{ {}, std::nullopt, 1.0, false } + detail::Settings{ .controls = {}, .selected = std::nullopt, .volume = 1.0, .discord = false } }; + + //TODO(Totto): save the file, if it doesn't exist, if it has an error, just leave it there } }