Skip to content

Commit d7c4a23

Browse files
empty2filljwindgassen
authored andcommitted
Fix UE version check
- FTabManager::InvokeTab is deprecated - TMicRecursionGuard
1 parent 589cac0 commit d7c4a23

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

Plugins/Linter/Source/Linter/Private/LintRule.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "IAssetRegistry.h"
1111
#include "IAssetTools.h"
1212
#include "AssetRegistryModule.h"
13+
#include "Misc/EngineVersionComparison.h"
1314

1415

1516
ULintRule::ULintRule(const FObjectInitializer& ObjectInitializer)
@@ -61,7 +62,7 @@ FName ULintRule::GetRuleBasedObjectVariantName_Implementation(UObject* ObjectToL
6162
UMaterialInterface* MI = Cast<UMaterialInterface>(ObjectToLint);
6263
if (MI != nullptr)
6364
{
64-
#if ENGINE_MINOR_VERSION >= 25
65+
#if UE_VERSION_NEWER_THAN(4, 25, 0)
6566
TMicRecursionGuard RecursionGuard;
6667
#else
6768
UMaterialInterface::TMicRecursionGuard RecursionGuard;

Plugins/Linter/Source/Linter/Private/LinterContentBrowserExtensions.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "TooltipEditor/TooltipTool.h"
1515
#include "Linter.h"
1616
#include "BatchRenameTool/BatchRenameTool.h"
17+
#include "Misc/EngineVersionComparison.h"
1718

1819
#define LOCTEXT_NAMESPACE "Linter"
1920
DEFINE_LOG_CATEGORY_STATIC(LinterContentBrowserExtensions, Log, All);
@@ -52,7 +53,11 @@ void FLinterContentBrowserExtensions::InstallHooks(FLinterModule* LinterModule,
5253
{
5354
lm->SetDesiredLintPaths(SelectedPaths);
5455
}
56+
#if UE_VERSION_NEWER_THAN(4, 26, 0)
57+
FGlobalTabmanager::Get()->TryInvokeTab(FName("LinterTab"));
58+
#else
5559
FGlobalTabmanager::Get()->InvokeTab(FName("LinterTab"));
60+
#endif
5661
}
5762
})),
5863
NAME_None,

Plugins/Linter/Source/Linter/Private/UI/LintWizard.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "Widgets/Docking/SDockTab.h"
2828
#include "Misc/App.h"
2929
#include "Engine/World.h"
30+
#include "Misc/EngineVersionComparison.h"
3031

3132
#include "LinterStyle.h"
3233
#include "LintRuleSet.h"
@@ -97,7 +98,11 @@ void SLintWizard::Construct(const FArguments& InArgs)
9798
.FinishButtonText(LOCTEXT("FinishButtonText", "Close"))
9899
.OnFinished_Lambda([&]()
99100
{
101+
#if UE_VERSION_NEWER_THAN(4, 26, 0)
102+
FGlobalTabmanager::Get()->TryInvokeTab(FName("LinterTab"))->RequestCloseTab();
103+
#else
100104
FGlobalTabmanager::Get()->InvokeTab(FName("LinterTab"))->RequestCloseTab();
105+
#endif
101106
})
102107
+ SWizard::Page()
103108
.CanShow_Lambda([&]() { return RuleSets.Num() > 0; })
@@ -530,7 +535,11 @@ void SLintWizard::Construct(const FArguments& InArgs)
530535
LOCTEXT("ZipTaskShortName", "Zip Project Task"), FEditorStyle::GetBrush(TEXT("MainFrame.CookContent")));
531536
}
532537

538+
#if UE_VERSION_NEWER_THAN(4, 26, 0)
539+
FGlobalTabmanager::Get()->TryInvokeTab(FName("LinterTab"))->RequestCloseTab();
540+
#else
533541
FGlobalTabmanager::Get()->InvokeTab(FName("LinterTab"))->RequestCloseTab();
542+
#endif
534543
}
535544
return FReply::Handled();
536545
})

0 commit comments

Comments
 (0)