Skip to content

Commit bff467d

Browse files
Preserve program shortcut in start menu
1 parent 8f58d53 commit bff467d

File tree

1 file changed

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

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,13 +603,20 @@ public static IEnumerable<T> DistinctBy<T, R>(IEnumerable<T> source, Func<T, R>
603603

604604
private static IEnumerable<Win32> ProgramsHasher(IEnumerable<Win32> programs)
605605
{
606+
var startMenuPaths = GetStartMenuPaths();
606607
return programs.GroupBy(p => p.ExecutablePath.ToLowerInvariant())
607608
.AsParallel()
608609
.SelectMany(g =>
609610
{
611+
// is shortcut and in start menu
612+
var startMenu = g.Where(g => g.LnkResolvedPath != null && startMenuPaths.Any(x => FilesFolders.PathContains(x, g.FullPath))).ToList();
613+
if (startMenu.Any())
614+
return startMenu.Take(1);
615+
616+
// distinct by description
610617
var temp = g.Where(g => !string.IsNullOrEmpty(g.Description)).ToList();
611618
if (temp.Any())
612-
return DistinctBy(temp, x => x.Description);
619+
return temp.Take(1);
613620
return g.Take(1);
614621
});
615622
}

0 commit comments

Comments
 (0)