Add null to disable OpenVR configuration
This commit is contained in:
@@ -154,7 +154,10 @@ configuration configuration::read_user_configuration()
|
||||
|
||||
if (auto it = json.find("openvr-compat-path"); it != json.end())
|
||||
{
|
||||
result.openvr_compat_path = *it;
|
||||
if (it->is_null())
|
||||
result.openvr_compat_path = nullptr;
|
||||
else
|
||||
result.openvr_compat_path = *it;
|
||||
}
|
||||
}
|
||||
catch (const std::exception & e)
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <map>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
|
||||
#include "wivrn_packets.h"
|
||||
|
||||
@@ -60,7 +61,9 @@ struct configuration
|
||||
std::vector<std::string> application;
|
||||
bool tcp_only = false;
|
||||
service_publication publication = service_publication::avahi;
|
||||
std::optional<std::string> openvr_compat_path;
|
||||
|
||||
// monostate: default value, string: user defined, nullptr: disabled
|
||||
std::variant<std::monostate, std::string, std::nullptr_t> openvr_compat_path;
|
||||
|
||||
static void set_config_file(const std::filesystem::path &);
|
||||
static const std::filesystem::path & get_config_file();
|
||||
|
||||
Reference in New Issue
Block a user