[client] enable configuration of spice via config

This commit is contained in:
Geoffrey McRae 2018-02-05 19:08:31 +11:00
parent a2216e4b68
commit fd8d4d3d38

View File

@ -1143,6 +1143,30 @@ static bool load_config(const char * configFile)
}
}
config_setting_t * spice = config_lookup(&cfg, "spice");
if (spice)
{
if (config_setting_lookup_bool(spice, "use", &itmp))
params.useSpice = (itmp != 0);
if (config_setting_lookup_string(spice, "host", &stmp))
{
free(params.spiceHost);
params.spiceHost = strdup(stmp);
}
if (config_setting_lookup_int(spice, "port", &itmp))
{
if (itmp < 1)
{
DEBUG_ERROR("Invalid spice port");
config_destroy(&cfg);
return false;
}
params.spicePort = itmp;
}
}
for(unsigned int i = 0; i < LG_RENDERER_COUNT; ++i)
{
const LG_Renderer * r = LG_Renderers[i];
@ -1450,4 +1474,4 @@ int main(int argc, char * argv[])
}
return ret;
}
}