SourceControl.Revert.EnableFromSubmitWidget
SourceControl.Revert.EnableFromSubmitWidget
#Overview
name: SourceControl.Revert.EnableFromSubmitWidget
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows a SourceControl \'Revert\' operation to be triggered from the SubmitWidget.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of SourceControl.Revert.EnableFromSubmitWidget is to control whether a source control ‘Revert’ operation can be triggered from the SubmitWidget in Unreal Engine’s editor interface.
This setting variable is primarily used by the Source Control system within Unreal Engine. It is specifically referenced in the SourceControlWindows module, which is responsible for the UI components related to source control operations in the editor.
The value of this variable is set through a console variable (CVar) system. It is defined in the SourceControlCVars namespace with a default value of false.
The associated variable CVarSourceControlEnableRevertFromSubmitWidget directly interacts with SourceControl.Revert.EnableFromSubmitWidget. They share the same value and purpose.
Developers must be aware that this variable controls a specific UI functionality. When set to true, it allows users to perform revert operations directly from the submit widget in the editor. This can be powerful but potentially dangerous if used incorrectly.
Best practices when using this variable include:
- Carefully consider the implications of enabling this feature, as it could lead to accidental loss of work if users are not careful.
- Ensure that your team is trained on the proper use of the revert functionality if it’s enabled.
- Consider enabling this only in specific development environments where the additional flexibility is needed, rather than in production or shared environments.
Regarding the associated variable CVarSourceControlEnableRevertFromSubmitWidget:
- Its purpose is identical to SourceControl.Revert.EnableFromSubmitWidget.
- It is used internally by the engine to store and access the value of the setting.
- The value is set when the engine initializes the console variables.
- It directly controls the behavior of the AllowRevert() function in the SSourceControlSubmitWidget class.
- Developers should not typically need to interact with this variable directly, as it’s an internal representation of the console variable.
- Best practice is to modify the SourceControl.Revert.EnableFromSubmitWidget setting through the appropriate engine configuration methods, rather than attempting to modify CVarSourceControlEnableRevertFromSubmitWidget directly.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Developer/SourceControl/Private/SourceControlCVars.cpp:11
Scope (from outer to inner):
file
namespace SourceControlCVars
Source code excerpt:
TAutoConsoleVariable<bool> CVarSourceControlEnableRevertFromSubmitWidget(
TEXT("SourceControl.Revert.EnableFromSubmitWidget"),
false,
TEXT("Allows a SourceControl 'Revert' operation to be triggered from the SubmitWidget."),
ECVF_Default);
TAutoConsoleVariable<bool> CVarSourceControlEnableRevertUnsaved(
TEXT("SourceControl.RevertUnsaved.Enable"),
#Loc: <Workspace>/Engine/Source/Editor/SourceControlWindows/Private/SSourceControlSubmit.cpp:537
Scope (from outer to inner):
file
function bool SSourceControlSubmitWidget::AllowRevert
Source code excerpt:
bool SSourceControlSubmitWidget::AllowRevert() const
{
if (IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("SourceControl.Revert.EnableFromSubmitWidget")))
{
return CVar->GetBool();
}
else
{
return false;
#Associated Variable and Callsites
This variable is associated with another variable named CVarSourceControlEnableRevertFromSubmitWidget
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Developer/SourceControl/Private/SourceControlCVars.cpp:10
Scope (from outer to inner):
file
namespace SourceControlCVars
Source code excerpt:
ECVF_Default);
TAutoConsoleVariable<bool> CVarSourceControlEnableRevertFromSubmitWidget(
TEXT("SourceControl.Revert.EnableFromSubmitWidget"),
false,
TEXT("Allows a SourceControl 'Revert' operation to be triggered from the SubmitWidget."),
ECVF_Default);
TAutoConsoleVariable<bool> CVarSourceControlEnableRevertUnsaved(
#Loc: <Workspace>/Engine/Source/Developer/SourceControl/Private/SourceControlCVars.h:8
Scope (from outer to inner):
file
namespace SourceControlCVars
Source code excerpt:
{
extern TAutoConsoleVariable<bool> CVarSourceControlEnableRevertFromSceneOutliner;
extern TAutoConsoleVariable<bool> CVarSourceControlEnableRevertFromSubmitWidget;
extern TAutoConsoleVariable<bool> CVarSourceControlEnableRevertUnsaved;
extern TAutoConsoleVariable<bool> CVarSourceControlEnableLoginDialogModal;
}