mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-24 17:52:17 +00:00
Move UserReporter C++/JS functions from JSInterface_Debug.cpp to JSInterface_UserReport.cpp, refs #4772.
This way it stands out more as a separate feature that can be more easily exchanged, extended, maintained or conditionally removed from the build and leaves more transparent includes, refs #5257. Add missing string includes following7c2e9027c2andd6cb9c845b. Remove unused Profile include following38d6f81d71andd6cb9c845b. Remove unused CLogger include, add missing debug include followingd6cb9c845b. Remove unused CConsole include following9f0484e5ce/ D1073. Remove unused ProfilerViewer include following2af94c5898. This was SVN commit r21866.
This commit is contained in:
@@ -21,13 +21,11 @@
|
||||
|
||||
#include "i18n/L10n.h"
|
||||
#include "lib/svn_revision.h"
|
||||
#include "ps/CConsole.h"
|
||||
#include "ps/CLogger.h"
|
||||
#include "ps/Profile.h"
|
||||
#include "ps/ProfileViewer.h"
|
||||
#include "ps/UserReport.h"
|
||||
#include "lib/debug.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
/**
|
||||
* Microseconds since the epoch.
|
||||
*/
|
||||
@@ -117,21 +115,6 @@ std::wstring JSI_Debug::GetBuildTimestamp(ScriptInterface::CxPrivate* UNUSED(pCx
|
||||
return wstring_from_utf8(buf);
|
||||
}
|
||||
|
||||
bool JSI_Debug::IsUserReportEnabled(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
|
||||
{
|
||||
return g_UserReporter.IsReportingEnabled();
|
||||
}
|
||||
|
||||
void JSI_Debug::SetUserReportEnabled(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), bool enabled)
|
||||
{
|
||||
g_UserReporter.SetReportingEnabled(enabled);
|
||||
}
|
||||
|
||||
std::string JSI_Debug::GetUserReportStatus(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
|
||||
{
|
||||
return g_UserReporter.GetStatus();
|
||||
}
|
||||
|
||||
void JSI_Debug::RegisterScriptFunctions(const ScriptInterface& scriptInterface)
|
||||
{
|
||||
scriptInterface.RegisterFunction<double, &GetMicroseconds>("GetMicroseconds");
|
||||
@@ -139,9 +122,4 @@ void JSI_Debug::RegisterScriptFunctions(const ScriptInterface& scriptInterface)
|
||||
scriptInterface.RegisterFunction<void, &DebugWarn>("DebugWarn");
|
||||
scriptInterface.RegisterFunction<void, std::wstring, &DisplayErrorDialog>("DisplayErrorDialog");
|
||||
scriptInterface.RegisterFunction<std::wstring, int, &GetBuildTimestamp>("GetBuildTimestamp");
|
||||
|
||||
// User report functions
|
||||
scriptInterface.RegisterFunction<bool, &IsUserReportEnabled>("IsUserReportEnabled");
|
||||
scriptInterface.RegisterFunction<void, bool, &SetUserReportEnabled>("SetUserReportEnabled");
|
||||
scriptInterface.RegisterFunction<std::string, &GetUserReportStatus>("GetUserReportStatus");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user