This commit is contained in:
@@ -95,13 +95,23 @@ mgmt_app_config::mgmt_app_config(bool hidden, bool launch_only)
|
|||||||
api_password_ = data.at(JSON_API_PASSWORD).get<std::string>();
|
api_password_ = data.at(JSON_API_PASSWORD).get<std::string>();
|
||||||
api_port_ = data.at(JSON_API_PORT).get<std::uint16_t>();
|
api_port_ = data.at(JSON_API_PORT).get<std::uint16_t>();
|
||||||
api_user_ = data.at(JSON_API_USER).get<std::string>();
|
api_user_ = data.at(JSON_API_USER).get<std::string>();
|
||||||
auto_start_ = data.contains(JSON_AUTO_START)
|
|
||||||
? data.at(JSON_AUTO_START).get<bool>()
|
|
||||||
: false;
|
|
||||||
mount_auto_start_ = from_json<bool>(data.at(JSON_MOUNT_AUTO_START));
|
|
||||||
locations_ = from_json<std::string>(data.at(JSON_MOUNT_LOCATIONS));
|
|
||||||
|
|
||||||
if (not data.contains(JSON_AUTO_START)) {
|
auto should_save{not data.contains(JSON_AUTO_START)};
|
||||||
|
auto_start_ = should_save ? false : data.at(JSON_AUTO_START).get<bool>();
|
||||||
|
|
||||||
|
if (data.contains(JSON_MOUNT_AUTO_START)) {
|
||||||
|
mount_auto_start_ = from_json<bool>(data.at(JSON_MOUNT_AUTO_START));
|
||||||
|
} else {
|
||||||
|
should_save = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (data.contains(JSON_MOUNT_LOCATIONS)) {
|
||||||
|
locations_ = from_json<std::string>(data.at(JSON_MOUNT_LOCATIONS));
|
||||||
|
} else {
|
||||||
|
should_save = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (should_save) {
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user