You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Merging //UE4/Release-4.18 @ CL 3709383 to Release-Staging-4.18 (//UE4/Release-Staging-4.18)
#rb none #jira [CL 3715930 by Ben Marsh in Staging-4.18 branch]
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
#include "HAL/PlatformProcess.h"
|
||||
#include "Misc/Paths.h"
|
||||
#include "DesktopPlatformModule.h"
|
||||
#include "Misc/UProjectInfo.h"
|
||||
#include "Misc/App.h"
|
||||
|
||||
DEFINE_LOG_CATEGORY_STATIC(LogCodeLiteAccessor, Log, All);
|
||||
|
||||
@@ -28,7 +30,7 @@ bool FCodeLiteSourceCodeAccessor::CanAccessSourceCode() const
|
||||
|
||||
FName FCodeLiteSourceCodeAccessor::GetFName() const
|
||||
{
|
||||
return FName("CodeLiteSourceCodeAccessor");
|
||||
return FName("CodeLite");
|
||||
}
|
||||
|
||||
FText FCodeLiteSourceCodeAccessor::GetNameText() const
|
||||
@@ -43,9 +45,18 @@ FText FCodeLiteSourceCodeAccessor::GetDescriptionText() const
|
||||
|
||||
bool FCodeLiteSourceCodeAccessor::OpenSolution()
|
||||
{
|
||||
FString Filename = FPaths::GetBaseFilename(GetSolutionPath()) + ".workspace";
|
||||
FString Directory = FPaths::GetPath(GetSolutionPath());
|
||||
FString Solution = "\"" + Directory + "/" + Filename + "\"";
|
||||
FString SolutionPath = GetSolutionPath();
|
||||
return OpenSolutionAtPath(SolutionPath);
|
||||
}
|
||||
|
||||
bool FCodeLiteSourceCodeAccessor::OpenSolutionAtPath(const FString& InSolutionPath)
|
||||
{
|
||||
FString SolutionPath = InSolutionPath;
|
||||
if (!SolutionPath.EndsWith(TEXT(".workspace")))
|
||||
{
|
||||
SolutionPath += TEXT(".workspace");
|
||||
}
|
||||
|
||||
FString CodeLitePath;
|
||||
if(!CanRunCodeLite(CodeLitePath))
|
||||
{
|
||||
@@ -53,18 +64,23 @@ bool FCodeLiteSourceCodeAccessor::OpenSolution()
|
||||
return false;
|
||||
}
|
||||
|
||||
UE_LOG(LogCodeLiteAccessor, Warning, TEXT("FCodeLiteSourceCodeAccessor::OpenSolution: %s %s"), *CodeLitePath, *Solution);
|
||||
UE_LOG(LogCodeLiteAccessor, Warning, TEXT("FCodeLiteSourceCodeAccessor::OpenSolution: \"%s\" \"%s\""), *CodeLitePath, *SolutionPath);
|
||||
|
||||
FProcHandle Proc = FPlatformProcess::CreateProc(*CodeLitePath, *Solution, true, false, false, nullptr, 0, nullptr, nullptr);
|
||||
FProcHandle Proc = FPlatformProcess::CreateProc(*CodeLitePath, *SolutionPath, true, false, false, nullptr, 0, nullptr, nullptr);
|
||||
if(Proc.IsValid())
|
||||
{
|
||||
FPlatformProcess::CloseProc(Proc);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
bool FCodeLiteSourceCodeAccessor::DoesSolutionExist() const
|
||||
{
|
||||
FString SolutionPath = GetSolutionPath();
|
||||
return FPaths::FileExists(SolutionPath);
|
||||
}
|
||||
|
||||
bool FCodeLiteSourceCodeAccessor::OpenSourceFiles(const TArray<FString>& AbsoluteSourcePaths)
|
||||
{
|
||||
FString CodeLitePath;
|
||||
@@ -156,10 +172,16 @@ FString FCodeLiteSourceCodeAccessor::GetSolutionPath() const
|
||||
{
|
||||
if(IsInGameThread())
|
||||
{
|
||||
FString SolutionPath;
|
||||
if(FDesktopPlatformModule::Get()->GetSolutionPath(SolutionPath))
|
||||
CachedSolutionPath = FPaths::ProjectDir();
|
||||
|
||||
if (!FUProjectDictionary(FPaths::RootDir()).IsForeignProject(CachedSolutionPath))
|
||||
{
|
||||
CachedSolutionPath = FPaths::ConvertRelativePathToFull(SolutionPath);
|
||||
CachedSolutionPath = FPaths::Combine(FPaths::RootDir(), TEXT("UE4.workspace"));
|
||||
}
|
||||
else
|
||||
{
|
||||
FString BaseName = FApp::HasProjectName() ? FApp::GetProjectName() : FPaths::GetBaseFilename(CachedSolutionPath);
|
||||
CachedSolutionPath = FPaths::Combine(CachedSolutionPath, BaseName + TEXT(".workspace"));
|
||||
}
|
||||
}
|
||||
return CachedSolutionPath;
|
||||
|
||||
@@ -39,6 +39,16 @@ public:
|
||||
*/
|
||||
virtual bool OpenSolution() override;
|
||||
|
||||
/**
|
||||
* Open the CodeLite Workspace for editing.
|
||||
*/
|
||||
virtual bool OpenSolutionAtPath(const FString& InSolutionPath) override;
|
||||
|
||||
/**
|
||||
* Open the CodeLite Workspace for editing.
|
||||
*/
|
||||
virtual bool DoesSolutionExist() const override;
|
||||
|
||||
/**
|
||||
* Open a file at a specific line and optional column.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user