Files
UnrealEngineUWP/Engine/Source/Editor/ConfigEditor/Private/ConfigPropertyHelper.cpp
Terence Burns 14cb541a13 Config Editor added to UE4.
We now have the capacity to set a uproperty value anywhere in the config file hierarchy

Satisfies UEPLAT-429

The user can now use the 'ConfigHierarchyEditable' meta flag in their uproperties to present a butoon that allows the property to be edited in the config hierarchy, where applicable.
Target platform is configurable.

[CL 2521330 by Terence Burns in Main branch]
2015-04-22 13:40:06 -04:00

43 lines
1.2 KiB
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "ConfigEditorPCH.h"
#include "ConfigPropertyHelper.h"
#include "ISourceControlModule.h"
void UPropertyConfigFileDisplayRow::InitWithConfigAndProperty(const FString& InConfigFileName, UProperty* InEditProperty)
{
ConfigFileName = FPaths::ConvertRelativePathToFull(InConfigFileName);
ExternalProperty = InEditProperty;
ISourceControlProvider& SourceControlProvider = ISourceControlModule::Get().GetProvider();
// We will add source control soon...
FSourceControlStatePtr SourceControlState = nullptr; // SourceControlProvider.GetState(ConfigFileName, EStateCacheUsage::Use);
// Only include config files that are currently checked out or packages not under source control
{
if (FPaths::FileExists(ConfigFileName))
{
if (SourceControlState.IsValid())
{
bIsFileWritable = SourceControlState->IsCheckedOut() || SourceControlState->IsAdded();
}
else
{
bIsFileWritable = !IFileManager::Get().IsReadOnly(*ConfigFileName);
}
}
else
{
if (SourceControlState.IsValid())
{
bIsFileWritable = (SourceControlState->IsSourceControlled() && SourceControlState->CanAdd());
}
else
{
bIsFileWritable = false;
}
}
}
}