Skip to content

Commit d661836

Browse files
re-organize linq
1 parent d1e8bbf commit d661836

File tree

1 file changed

+8
-5
lines changed
  • Plugins/Flow.Launcher.Plugin.Program/Programs

1 file changed

+8
-5
lines changed

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -379,12 +379,15 @@ private static string Extension(string path)
379379
private static IEnumerable<Win32> UnregisteredPrograms(List<ProgramSource> sources, string[] suffixes, string[] protocols)
380380
{
381381
// Disabled custom sources are not in DisabledProgramSources
382-
var paths = ExceptDisabledSource(sources.Where(s => Directory.Exists(s.Location) && s.Enabled)
382+
var paths = sources.Where(s => Directory.Exists(s.Location) && s.Enabled)
383+
.Distinct()
383384
.AsParallel()
384-
.SelectMany(s => ProgramPaths(s.Location, suffixes)))
385-
.Distinct();
385+
.SelectMany(s => ProgramPaths(s.Location, suffixes));
386386

387-
var programs = paths.Select(x => GetProgramFromPath(x, protocols));
387+
// Remove disabled programs in DisabledProgramSources
388+
var programs = ExceptDisabledSource(paths)
389+
390+
.Select(x => GetProgramFromPath(x, protocols));
388391
return programs;
389392
}
390393

@@ -569,7 +572,7 @@ public static Win32[] All(Settings settings)
569572

570573
programs = programs.Concat(unregistered);
571574

572-
var autoIndexPrograms = Enumerable.Empty<Win32>();
575+
var autoIndexPrograms = Enumerable.Empty<Win32>(); // for single programs, not folders
573576

574577
if (settings.EnableRegistrySource)
575578
{

0 commit comments

Comments
 (0)