mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Review update
This commit is contained in:
parent
963c6eaae9
commit
31453e5942
3 changed files with 8 additions and 5 deletions
|
|
@ -191,11 +191,11 @@ namespace Flow.Launcher.Plugin.Program
|
|||
return;
|
||||
|
||||
if (_uwps.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
|
||||
_uwps.FirstOrDefault(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)
|
||||
_uwps.First(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)
|
||||
.Enabled = false;
|
||||
|
||||
if (_win32s.Any(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier))
|
||||
_win32s.FirstOrDefault(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)
|
||||
_win32s.First(x => x.UniqueIdentifier == programToDelete.UniqueIdentifier)
|
||||
.Enabled = false;
|
||||
|
||||
_settings.DisabledProgramSources.Add(new DisabledProgramSource(programToDelete));
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ namespace Flow.Launcher.Plugin.Program.Views.Models
|
|||
public string Location { get; set; }
|
||||
public string Name { get => name ?? new DirectoryInfo(Location).Name; set => name = value; }
|
||||
public bool Enabled { get; set; } = true;
|
||||
private string uid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Guranteed lowercase.
|
||||
/// Guaranteed lowercase.
|
||||
/// </summary>
|
||||
public string UniqueIdentifier { get => uid; set => uid = value.ToLowerInvariant(); }
|
||||
private string uid { get; set; }
|
||||
|
||||
public ProgramSource() { } // only for json deserialization
|
||||
|
||||
|
|
@ -74,6 +74,8 @@ namespace Flow.Launcher.Plugin.Program.Views.Models
|
|||
|
||||
public class DisabledProgramSource : ProgramSource
|
||||
{
|
||||
public new bool Enabled { get; init; }
|
||||
|
||||
public DisabledProgramSource() { } // only for json deserialization
|
||||
|
||||
public DisabledProgramSource(string location) : base(location, false) { }
|
||||
|
|
|
|||
|
|
@ -199,7 +199,8 @@ namespace Flow.Launcher.Plugin.Program.Views
|
|||
{
|
||||
foreach (string directory in directories)
|
||||
{
|
||||
if (Directory.Exists(directory) && !ProgramSettingDisplayList.Any(x => x.UniqueIdentifier == directory.ToLowerInvariant()))
|
||||
if (Directory.Exists(directory)
|
||||
&& !ProgramSettingDisplayList.Any(x => x.UniqueIdentifier.Equals(directory, System.StringComparison.InvariantCultureIgnoreCase)))
|
||||
{
|
||||
var source = new ProgramSource(directory);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue