Make ConfigDB properly thread-safe.

Replace CreateValue with SetValueString so we don't pass pointers to
internal
 ConfigDB structures around. Refs #1810.
Remove some splash screen related functions since we can achieve the
same
 with the ConfigDB functions exposed to scripts.

This was SVN commit r14437.
This commit is contained in:
leper
2013-12-29 23:56:18 +00:00
parent 92fba32c5e
commit 5e23445339
9 changed files with 100 additions and 95 deletions
-19
View File
@@ -504,21 +504,6 @@ bool IsUserReportEnabled(void* UNUSED(cbdata))
return g_UserReporter.IsReportingEnabled();
}
bool IsSplashScreenEnabled(void* UNUSED(cbdata))
{
bool splashScreenEnable = true;
CFG_GET_VAL("splashscreenenable", Bool, splashScreenEnable);
return splashScreenEnable;
}
void SetSplashScreenEnabled(void* UNUSED(cbdata), bool enabled)
{
CStr val = (enabled ? "true" : "false");
g_ConfigDB.CreateValue(CFG_USER, "splashscreenenable")->m_String = val;
g_ConfigDB.WriteFile(CFG_USER);
}
void SetUserReportEnabled(void* UNUSED(cbdata), bool enabled)
{
g_UserReporter.SetReportingEnabled(enabled);
@@ -701,10 +686,6 @@ void GuiScriptingInit(ScriptInterface& scriptInterface)
scriptInterface.RegisterFunction<std::string, &GetUserReportStatus>("GetUserReportStatus");
scriptInterface.RegisterFunction<void, std::string, int, std::wstring, &SubmitUserReport>("SubmitUserReport");
// Splash screen functions
scriptInterface.RegisterFunction<bool, &IsSplashScreenEnabled>("IsSplashScreenEnabled");
scriptInterface.RegisterFunction<void, bool, &SetSplashScreenEnabled>("SetSplashScreenEnabled");
// Development/debugging functions
scriptInterface.RegisterFunction<void, float, &SetSimRate>("SetSimRate");
scriptInterface.RegisterFunction<float, &GetSimRate>("GetSimRate");