本文整理汇总了C++中FSourceControlStatePtr::CanCheckIn方法的典型用法代码示例。如果您正苦于以下问题:C++ FSourceControlStatePtr::CanCheckIn方法的具体用法?C++ FSourceControlStatePtr::CanCheckIn怎么用?C++ FSourceControlStatePtr::CanCheckIn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSourceControlStatePtr
的用法示例。
在下文中一共展示了FSourceControlStatePtr::CanCheckIn方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CacheCanExecuteVars
void FPathContextMenu::CacheCanExecuteVars()
{
// Cache whether we can execute any of the source control commands
bCanExecuteSCCCheckOut = false;
bCanExecuteSCCOpenForAdd = false;
bCanExecuteSCCCheckIn = false;
ISourceControlProvider& SourceControlProvider = ISourceControlModule::Get().GetProvider();
if ( SourceControlProvider.IsEnabled() && SourceControlProvider.IsAvailable() )
{
TArray<FString> PackageNames;
GetPackageNamesInSelectedPaths(PackageNames);
// Check the SCC state for each package in the selected paths
for ( auto PackageIt = PackageNames.CreateConstIterator(); PackageIt; ++PackageIt )
{
FSourceControlStatePtr SourceControlState = SourceControlProvider.GetState(SourceControlHelpers::PackageFilename(*PackageIt), EStateCacheUsage::Use);
if(SourceControlState.IsValid())
{
if ( SourceControlState->CanCheckout() )
{
bCanExecuteSCCCheckOut = true;
}
else if ( !SourceControlState->IsSourceControlled() )
{
bCanExecuteSCCOpenForAdd = true;
}
else if ( SourceControlState->CanCheckIn() )
{
bCanExecuteSCCCheckIn = true;
}
}
if ( bCanExecuteSCCCheckOut && bCanExecuteSCCOpenForAdd && bCanExecuteSCCCheckIn )
{
// All SCC options are available, no need to keep iterating
break;
}
}
}
}