From ae3430a9f5e39ff6f7f33b95f196d69bb3d174c0 Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Mon, 5 Dec 2022 00:59:50 +0100 Subject: [PATCH] Ensure that all options start at their default Before loading options, set them all to their default values. This way, if anything goes wrong while loading, we fall back to the default. This is especially relevant for options like fonts whose default is determined at runtime. --- client/options.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/options.cpp b/client/options.cpp index 222fcb9a8a..281ce390ec 100644 --- a/client/options.cpp +++ b/client/options.cpp @@ -4246,6 +4246,11 @@ void options_load() const char *const prefix = "client"; const char *str; + // Ensure all options start with their default value + for (auto &option : client_options) { + option_reset(OPTION(&option)); + } + name = get_last_option_file_name(&allow_digital_boolean); if (!name) { qInfo(_("Didn't find the option file. Creating a new one."));