AutomationPresetRef FAutomationTestPresetManager::AddNewPreset( const FText& PresetName, const TArray<FString>& SelectedTests ) { AutomationPresetRef NewPreset = AddNewPreset(); NewPreset->SetPresetName(PresetName); NewPreset->SetEnabledTests(SelectedTests); SavePreset(NewPreset); return NewPreset; }
AutomationPresetPtr FAutomationTestPresetManager::AddNewPreset( const FText& PresetName, const TArray<FString>& SelectedTests ) { if ( PresetName.IsEmpty() ) { return nullptr; } const FName NewNameSlug = MakeObjectNameFromDisplayLabel(PresetName.ToString(), NAME_None); if ( !Presets.FindByPredicate([&NewNameSlug] (const AutomationPresetPtr& Preset) { return Preset.IsValid() && Preset->GetID() == NewNameSlug; }) ) { AutomationPresetRef NewPreset = MakeShareable(new FAutomationTestPreset(NewNameSlug)); NewPreset->SetName(PresetName); NewPreset->SetEnabledTests(SelectedTests); Presets.Add(NewPreset); SavePreset(NewPreset); return NewPreset; } return nullptr; }