Skip to content

Commit

Permalink
Fix SOURCE_CONTROL_WITH_SLATE to work properly again in the SourceCon…
Browse files Browse the repository at this point in the history
…trol 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]
  • Loading branch information
SRombautsU committed Dec 5, 2023
1 parent d53dce7 commit 088f2dc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Source/PlasticSourceControl/Private/PlasticSourceControlState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "Styling/AppStyle.h"
#if ENGINE_MINOR_VERSION >= 2
#include "RevisionControlStyle/RevisionControlStyle.h"
#endif
#endif // ENGINE_MAJOR_VERSION
#endif

#define LOCTEXT_NAMESPACE "PlasticSourceControl.State"
Expand Down Expand Up @@ -234,6 +234,8 @@ FName FPlasticSourceControlState::GetSmallIconName() const

#elif ENGINE_MAJOR_VERSION == 5

#if SOURCE_CONTROL_WITH_SLATE

FSlateIcon FPlasticSourceControlState::GetIcon() const
{
#if ENGINE_MINOR_VERSION >= 2
Expand Down Expand Up @@ -261,7 +263,7 @@ FSlateIcon FPlasticSourceControlState::GetIcon() const
}
}

#else
#else // ENGINE_MINOR_VERSION < 2

if (!IsCurrent())
{
Expand All @@ -286,7 +288,7 @@ FSlateIcon FPlasticSourceControlState::GetIcon() const
}
}

#endif
#endif // ENGINE_MINOR_VERSION

#if ENGINE_MINOR_VERSION >= 2 // UE5.2+

Expand Down Expand Up @@ -347,7 +349,7 @@ FSlateIcon FPlasticSourceControlState::GetIcon() const
return FSlateIcon();
}

#else // UE5.0
#else // ENGINE_MINOR_VERSION UE5.0

switch (WorkspaceState)
{
Expand Down Expand Up @@ -383,10 +385,12 @@ FSlateIcon FPlasticSourceControlState::GetIcon() const
return FSlateIcon();
}

#endif
#endif // ENGINE_MINOR_VERSION
}

#endif
#endif // SOURCE_CONTROL_WITH_SLATE

#endif // ENGINE_MAJOR_VERSION

FText FPlasticSourceControlState::GetDisplayName() const
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ class FPlasticSourceControlState : public ISourceControlState
#if ENGINE_MINOR_VERSION >= 3
virtual FResolveInfo GetResolveInfo() const override; /* NOTE: added in UE5.3 */
#endif
#if SOURCE_CONTROL_WITH_SLATE
virtual FSlateIcon GetIcon() const override;
#endif // SOURCE_CONTROL_WITH_SLATE
#endif
virtual FText GetDisplayName() const override;
virtual FText GetDisplayTooltip() const override;
Expand Down

0 comments on commit 088f2dc

Please sign in to comment.