You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
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:
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user