Skip to content

Commit

Permalink
Ensure that all options start at their default
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lmoureaux committed Dec 7, 2022
1 parent 32d9d73 commit ae3430a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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."));
Expand Down

0 comments on commit ae3430a

Please sign in to comment.