use shallow copy

This commit is contained in:
Vic 2022-10-24 23:16:09 +08:00
parent 9bf1645a40
commit 8a4ff3bada
2 changed files with 2 additions and 4 deletions

View file

@ -9,7 +9,7 @@ namespace Flow.Launcher.Plugin.Program
{ {
public DateTime LastIndexTime { get; set; } public DateTime LastIndexTime { get; set; }
public List<ProgramSource> ProgramSources { get; set; } = new List<ProgramSource>(); public List<ProgramSource> ProgramSources { get; set; } = new List<ProgramSource>();
public List<DisabledProgramSource> DisabledProgramSources { get; set; } = new List<DisabledProgramSource>(); public List<DisabledProgramSource> DisabledProgramSources { get; set; } = new List<DisabledProgramSource>(); // For disabled single programs
public string[] ProgramSuffixes { get; set; } = {"appref-ms", "exe", "lnk"}; public string[] ProgramSuffixes { get; set; } = {"appref-ms", "exe", "lnk"};
public bool EnableStartMenuSource { get; set; } = true; public bool EnableStartMenuSource { get; set; } = true;

View file

@ -11,9 +11,7 @@ namespace Flow.Launcher.Plugin.Program.Views.Commands
{ {
internal static List<ProgramSource> LoadProgramSources(this List<ProgramSource> programSources) internal static List<ProgramSource> LoadProgramSources(this List<ProgramSource> programSources)
{ {
var list = new List<ProgramSource>(); var list = new List<ProgramSource>(programSources);
programSources.ForEach(x => list.Add(new ProgramSource(x)));
// Even though these are disabled, we still want to display them so users can enable later on // Even though these are disabled, we still want to display them so users can enable later on
Main._settings Main._settings