Fix SOURCE_CONTROL_WITH_SLATE to work properly again in the SourceControl module

#rb wouter.burgers
#rnx

### SourceControl
- Remove link to "InputCore" as it is not used
- Only include slate and rendering modules if the target we are building for uses slate.
- Define SOURCE_CONTROL_WITH_SLATE as 0 if the target we are building for does not use slate.

- When SOURCE_CONTROL_WITH_SLATE is zero the following will be applied:
-- FRevisionControlStyleManager will not be compiled as it only makes sense if slate is enabled.
-- The monitoring aspect of FSourceControlFileStatusMonitor will be disabled as we cannot be notified of user interactions.
-- FScopedSourceControlProgress will compile but essentially do nothing.
-- The ::GetIcon method of ISourceControlState will no longer be compiled as it returns a FSlateIcon by value.

[CL 29516345 by paul chipchase in ue5-main branch]
This commit is contained in:
paul chipchase
2023-11-07 06:18:43 -05:00
parent aa6f1ee98c
commit 0743e8dd17
14 changed files with 90 additions and 28 deletions

View File

@@ -2,13 +2,17 @@
#include "SourceControlFileStatusMonitor.h"
#include "Framework/Application/SlateApplication.h"
#include "HAL/PlatformTime.h"
#include "ISourceControlModule.h"
#include "ISourceControlProvider.h"
#include "Math/NumericLimits.h"
#include "SourceControlOperations.h"
#include "Misc/ScopeExit.h"
#include "ProfilingDebugging/CpuProfilerTrace.h"
#include "SourceControlOperations.h"
#if SOURCE_CONTROL_WITH_SLATE
#include "Framework/Application/SlateApplication.h"
#endif //#if SOURCE_CONTROL_WITH_SLATE
FSourceControlFileStatusMonitor::FSourceControlFileStatusMonitor()
: ProbationPeriodPolicy(FTimespan::FromSeconds(1))
@@ -17,8 +21,13 @@ FSourceControlFileStatusMonitor::FSourceControlFileStatusMonitor()
TickerHandle = FTSTicker::GetCoreTicker().AddTicker(FTickerDelegate::CreateRaw(this, &FSourceControlFileStatusMonitor::Tick));
SetSuspendMonitoringPolicy([]()
{
#if SOURCE_CONTROL_WITH_SLATE
// By default, suspend monitoring if the user didn't interact for the last 5 minutes.
return FPlatformTime::Seconds() - FSlateApplication::Get().GetLastUserInteractionTime() > FTimespan::FromMinutes(5).GetTotalSeconds();
#else
// Without slate there is not user interaction, so we always suspend the monitoring
return true;
#endif //SOURCE_CONTROL_WITH_SLATE
});
}