Remove DisabledProgramSource()

This commit is contained in:
Vic 2022-10-20 16:55:14 +08:00
parent db67d3b925
commit 4da7a5e078
3 changed files with 3 additions and 30 deletions

View file

@ -204,16 +204,7 @@ namespace Flow.Launcher.Plugin.Program
_win32s.FirstOrDefault(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)
.Enabled = false;
_settings.DisabledProgramSources
.Add(
new DisabledProgramSource
{
Name = programToDelete.Name,
Location = programToDelete.Location,
UniqueIdentifier = programToDelete.UniqueIdentifier,
Enabled = false
}
);
_settings.DisabledProgramSources.Add(new DisabledProgramSource(programToDelete));
}
public static void StartProcess(Func<ProcessStartInfo, Process> runProcess, ProcessStartInfo info)

View file

@ -107,15 +107,7 @@ namespace Flow.Launcher.Plugin.Program.Views.Commands
&& !Main._settings.DisabledProgramSources.Any(x => x.UniqueIdentifier == t1.UniqueIdentifier))
.ToList()
.ForEach(x => Main._settings.DisabledProgramSources
.Add(
new DisabledProgramSource
{
Name = x.Name,
Location = x.Location,
UniqueIdentifier = x.UniqueIdentifier,
Enabled = false
}
));
.Add(new DisabledProgramSource(x)));
}
internal static void RemoveDisabledFromSettings(this List<ProgramSource> list)

View file

@ -68,16 +68,6 @@ namespace Flow.Launcher.Plugin.Program.Views.Models
return program != null && program.UniqueIdentifier == this.UniqueIdentifier;
}
public static bool operator ==(ProgramSource a, ProgramSource b)
{
return a is not null && a.Equals(b);
}
public static bool operator !=(ProgramSource a, ProgramSource b)
{
return !(a == b);
}
public override int GetHashCode()
{
return HashCode.Combine(uid);
@ -86,7 +76,7 @@ namespace Flow.Launcher.Plugin.Program.Views.Models
public class DisabledProgramSource : ProgramSource
{
public DisabledProgramSource() { }
//public DisabledProgramSource() { }
public DisabledProgramSource(string location) : base(location, false) { }