Skip to content

Commit

Permalink
Merge pull request #18 from outoftheboxplugins/feature/fixed-lambda-f…
Browse files Browse the repository at this point in the history
…or-all-cpp-standards

Feature/fixed lambda for all cpp standards
  • Loading branch information
pasotee authored Jan 31, 2024
2 parents 96e928e + 850c51f commit e1b5b14
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 12 deletions.
17 changes: 6 additions & 11 deletions Source/TolgeeEditor/Private/TolgeeEditorIntegrationSubsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
#include <LocalizationConfigurationScript.h>
#include <LocalizationSettings.h>
#include <LocalizationTargetTypes.h>
#include <Misc/EngineVersionComparison.h>
#include <Misc/FeedbackContext.h>
#include <Misc/FileHelper.h>
#include <Misc/EngineVersionComparison.h>
#include <Misc/MessageDialog.h>
#include <Serialization/JsonInternationalizationManifestSerializer.h>
#include <Settings/ProjectPackagingSettings.h>
Expand Down Expand Up @@ -125,7 +125,7 @@ void UTolgeeEditorIntegrationSubsystem::PurgeUnusedKeys()
FKeysDeletePayload Payload;
for (const auto& Key : UnusedRemoteKeys)
{
if(Key.RemoteId.IsSet())
if (Key.RemoteId.IsSet())
{
UE_LOG(LogTolgee, Log, TEXT("- id:%s namespace:%s key:%s"), *LexToString(Key.RemoteId.GetValue()), *Key.Namespace, *Key.Name);
Payload.Ids.Add(Key.RemoteId.GetValue());
Expand Down Expand Up @@ -353,7 +353,7 @@ void UTolgeeEditorIntegrationSubsystem::OnUnusedKeysPurged(FHttpRequestPtr Reque
GEngine->GetEngineSubsystem<UTolgeeLocalizationSubsystem>()->ManualFetch();
}

void UTolgeeEditorIntegrationSubsystem::OnMainFrameReady()
void UTolgeeEditorIntegrationSubsystem::OnMainFrameReady(TSharedPtr<SWindow> InRootWindow, bool bIsRunningStartupDialog)
{
// The browser plugin CEF version is too old to render the Tolgee website before 5.0
#if UE_VERSION_NEWER_THAN(5, 0, 0)
Expand Down Expand Up @@ -425,17 +425,12 @@ void UTolgeeEditorIntegrationSubsystem::Initialize(FSubsystemCollectionBase& Col
IMainFrameModule& MainFrameModule = IMainFrameModule::Get();
if (MainFrameModule.IsWindowInitialized())
{
OnMainFrameReady();
const TSharedPtr<SWindow> RootWindow = FSlateApplication::Get().GetActiveTopLevelWindow();
OnMainFrameReady(RootWindow, false);
}
else
{
MainFrameModule.OnMainFrameCreationFinished().AddWeakLambda(
this,
[=](TSharedPtr<SWindow> InRootWindow, bool bIsRunningStartupDialog)
{
OnMainFrameReady();
}
);
MainFrameModule.OnMainFrameCreationFinished().AddUObject(this, &UTolgeeEditorIntegrationSubsystem::OnMainFrameReady);
}

#if ENGINE_MAJOR_VERSION > 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class UTolgeeEditorIntegrationSubsystem : public UEditorSubsystem
/**
* @brief Callback executed when the editor main frame is ready to display the login pop-up
*/
void OnMainFrameReady();
void OnMainFrameReady(TSharedPtr<SWindow> InRootWindow, bool bIsRunningStartupDialog);
/**
* @brief Exports the locally available data to a file on disk to package it in the final build
*/
Expand Down

0 comments on commit e1b5b14

Please sign in to comment.