From b38b6d00a82bcf96eea3016572fdb6eec097d049 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 18 Oct 2022 07:23:39 +1100 Subject: [PATCH 01/16] [Dev] Update with adjustment shortcut wording Update with adjustment shortcut wording --- Flow.Launcher/Languages/en.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 824201f7d..278b9171c 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -41,7 +41,7 @@ Select last Query Empty last Query Maximum results shown - You can also quickly adjust this by using CTRL+Plus and CTRL+Minus. + You can also quickly adjust this by using CTRL+Equals and CTRL+Minus. Ignore hotkeys in fullscreen mode Disable Flow Launcher activation when a full screen application is active (Recommended for games). Default File Manager From e656d84042e1cce789ef819972b2022111fe1608 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Oct 2022 22:37:26 +0000 Subject: [PATCH 02/16] Bump NUnit3TestAdapter from 4.0.0 to 4.2.1 Bumps [NUnit3TestAdapter](https://github.com/nunit/nunit3-vs-adapter) from 4.0.0 to 4.2.1. - [Release notes](https://github.com/nunit/nunit3-vs-adapter/releases) - [Commits](https://github.com/nunit/nunit3-vs-adapter/compare/V4.0.0...V4.2.1) --- updated-dependencies: - dependency-name: NUnit3TestAdapter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Flow.Launcher.Test/Flow.Launcher.Test.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Test/Flow.Launcher.Test.csproj b/Flow.Launcher.Test/Flow.Launcher.Test.csproj index f429586ce..c4341288f 100644 --- a/Flow.Launcher.Test/Flow.Launcher.Test.csproj +++ b/Flow.Launcher.Test/Flow.Launcher.Test.csproj @@ -50,7 +50,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 798567e9c571b1844e2d94c4b4a4fd954c855346 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 18 Oct 2022 13:15:24 +1100 Subject: [PATCH 03/16] [Dev] Update wording Update wording --- Flow.Launcher/Languages/en.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 278b9171c..824201f7d 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -41,7 +41,7 @@ Select last Query Empty last Query Maximum results shown - You can also quickly adjust this by using CTRL+Equals and CTRL+Minus. + You can also quickly adjust this by using CTRL+Plus and CTRL+Minus. Ignore hotkeys in fullscreen mode Disable Flow Launcher activation when a full screen application is active (Recommended for games). Default File Manager From 521e8976bec95f23ab9b717f73fa50f0bf62979e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 21:06:58 +0000 Subject: [PATCH 04/16] Bump Mages from 2.0.0 to 2.0.1 Bumps [Mages](https://github.com/FlorianRappl/Mages) from 2.0.0 to 2.0.1. - [Release notes](https://github.com/FlorianRappl/Mages/releases) - [Changelog](https://github.com/FlorianRappl/Mages/blob/devel/CHANGELOG.md) - [Commits](https://github.com/FlorianRappl/Mages/compare/v2.0.0...v2.0.1) --- updated-dependencies: - dependency-name: Mages dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .../Flow.Launcher.Plugin.Calculator.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj index 0fe809926..e65e7d497 100644 --- a/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj +++ b/Plugins/Flow.Launcher.Plugin.Calculator/Flow.Launcher.Plugin.Calculator.csproj @@ -62,7 +62,7 @@ - + \ No newline at end of file From 2c87dd448124df56a2fd44393775338b9228be79 Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 19 Oct 2022 13:21:33 +0900 Subject: [PATCH 05/16] Remove ColorProfileData in app_missing_img --- Flow.Launcher/Images/app_missing_img.png | Bin 2869 -> 1234 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Flow.Launcher/Images/app_missing_img.png b/Flow.Launcher/Images/app_missing_img.png index b86c29ac9a8c0c1900ed7185b2b2ac69fb2d5df4..27e366bbc9091142cc777c885719326ec2fa0860 100644 GIT binary patch delta 1214 zcmV;v1VQ_?7SaijB!3xnMObuGZ)S9NVRB^vL1b@YWgtmyVP|DhWnpA_ami&o000DZ zNkl(d`TE3KFoz1!`!%k_Ens=Ai|fbQ}!&>cU{2AmD}!+#?VFTYYwrr#4Rbo_}2D+qW@aJj~}uqHtL! zZ}h^rs;wE#X);2X_Eb0e2vS~{ZuCC)^Z7cD{2U?lE}xfDAxm)6%6hoQQn-6~V}>1N z^630mqXCb41%HDtsZ4{jYtS}* z?shwhk00#maC1Yq+m)gtcFfuf%a4-*1I7J*pS_=M#{jVhOjd%j6=D&l2n_j*7Z(@P zIBrGp!eAP(@F^Lbi#kA2%*VemplTY}#$K&}{fy@Xm%;{PrK%AA9yCO?1NV8M=1$ST zO>ACflYfA|*HQ*-ZrxxYcL~#wZRv^32dv26-lbSLE-RT)sV07k;r z+R@Rd<7qf`UonT_Wj$|&(#&9JX6PcwWkq0ZHC%ydI2mHF$68NYEgabMn4CB9Sx<|? zGJgjTsdOh7lHH(dh#(H2M@qDl$5*<{Q+3mjBR#F63rA`7Ob`i6@@O_olBYdS&nYcJ zJ*Tvl^mQK?ccbf#ewP6s#Ay3?`r++-( z)2dOV07*qoM6N<$g7>pGOaK4? literal 2869 zcmbVO3se(l79I%FqGCX?idBdKMT^PgX_CPpk02lfkf4B6>o}Q&lq3@}69{N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+0900 Subject: [PATCH 06/16] Removed ColorProfile in ControlPanelIcon --- .../Images/ControlPanel_Small.png | Bin 2980 -> 2070 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.WindowsSettings/Images/ControlPanel_Small.png b/Plugins/Flow.Launcher.Plugin.WindowsSettings/Images/ControlPanel_Small.png index 8a8a41aeb8f370ac29e8164a6e31f2133ffbff53..0897fd7888ab170a14f8d3a52ef68e09644ad847 100644 GIT binary patch delta 11 ScmZ1?K22bP$L4Fy=hy)o<^-Dn delta 926 zcmaJ=y>8Vo6h>lTMPgvJ+yx{Y+evOxM-5ebbFW&73st#NyZSG^QJXkQTyEMW5>LRy z6RbAL*Qs-EoQ5@H%6 zLXv?f>TLzwKE-+<`Vd7)oM=k@kHj@Oua1efJtZI#{HQ~h7ZgW2u; zrq(?^)vdX1q;~l`+t;psk24L4PEPWnDcr~KtIWvjQdjmkOQE~*RG|_-Ac2S^M~X!; z@>M7h%OipWQKL~5`##A7*l&Oy0>}=h@p$)OI`Zk1(#d$2Qo1|w5B-cC9I{Ec6>(g( zmRC}5$qPrmc{_RZZ8C0p&8=zX#$2Uv-3liQV@U9I@3+@ zNvmmNO0cSPQaqr5IgcdL0g4EV5a*$D9y8)<5Qsd~QU*~DLB9r2_v*LqRTptK>aCbW z%bWyU2t)!&&`5<0F~K85A{9rHF%soD#7-j~dgop*Z9}d@hwa^PxPu$77wh@bl^d$Y OO^^8f{rJc9&$EAa{U#&; From f7eb99d7760f643e120173f9754f31657c4201f5 Mon Sep 17 00:00:00 2001 From: DB p Date: Wed, 19 Oct 2022 14:39:27 +0900 Subject: [PATCH 07/16] Add Ignore ColorProfile Code --- Flow.Launcher.Infrastructure/Image/ImageLoader.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs index 8c1d7d74f..11f66c8af 100644 --- a/Flow.Launcher.Infrastructure/Image/ImageLoader.cs +++ b/Flow.Launcher.Infrastructure/Image/ImageLoader.cs @@ -252,6 +252,7 @@ namespace Flow.Launcher.Infrastructure.Image image.BeginInit(); image.CacheOption = BitmapCacheOption.OnLoad; image.UriSource = new Uri(path); + image.CreateOptions = BitmapCreateOptions.IgnoreColorProfile; image.EndInit(); return image; } From 13a8f82bfe5b8ef9d7bdac59606b1b886e8c90e7 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sat, 15 Oct 2022 21:24:02 +0800 Subject: [PATCH 08/16] Add PATH environment variable to program source --- .../Programs/Win32.cs | 41 +++++++++++++++++++ .../Flow.Launcher.Plugin.Program/Settings.cs | 3 +- .../Views/ProgramSetting.xaml | 9 ++++ .../Views/ProgramSetting.xaml.cs | 14 ++++++- 4 files changed, 64 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index 6a8b232e9..cb467f740 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -17,6 +17,7 @@ using System.Diagnostics; using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch; using System.Diagnostics.CodeAnalysis; using System.Threading.Channels; +using System.Collections.ObjectModel; namespace Flow.Launcher.Plugin.Program.Programs { @@ -275,6 +276,14 @@ namespace Flow.Launcher.Plugin.Program.Programs program.Valid = false; return program; } + catch (FileNotFoundException e) + { + ProgramLogger.LogException($"|Win32|LnkProgram|{path}" + + "|An unexpected error occurred in the calling method LnkProgram", e); + + program.Valid = false; + return program; + } #if !DEBUG //Only do a catch all in production. This is so make developer aware of any unhandled exception and add the exception handling in. catch (Exception e) { @@ -370,6 +379,32 @@ namespace Flow.Launcher.Plugin.Program.Programs return programs; } + private static IEnumerable PATHPrograms(string[] suffixes) + { + var disabledProgramsList = Main._settings.DisabledProgramSources; + + string? pathEnv = Environment.GetEnvironmentVariable("Path"); + if (String.IsNullOrEmpty(pathEnv)) { + return Array.Empty(); + } + + var toFilter = new List(); + var paths = pathEnv.Split(";", StringSplitOptions.RemoveEmptyEntries).ToList().ConvertAll(x => x.ToLower()).Distinct(); + + foreach (var path in paths) + { + var p = ProgramPaths(path, suffixes); + toFilter.AddRange(p); + } + var programs = ExceptDisabledSource(toFilter.Distinct()) + .Select(x => Extension(x) switch + { + ShortcutExtension => LnkProgram(x), + _ => Win32Program(x) + }).Where(x => x.Valid); + return programs; + } + private static IEnumerable AppPathsPrograms(string[] suffixes) { // https://msdn.microsoft.com/en-us/library/windows/desktop/ee872121 @@ -522,6 +557,12 @@ namespace Flow.Launcher.Plugin.Program.Programs autoIndexPrograms = autoIndexPrograms.Concat(startMenu); } + if (settings.EnablePATHSource) + { + var path = PATHPrograms(settings.ProgramSuffixes); + autoIndexPrograms = autoIndexPrograms.Concat(path); + } + autoIndexPrograms = ProgramsHasher(autoIndexPrograms); return programs.Concat(autoIndexPrograms).Distinct().ToArray(); diff --git a/Plugins/Flow.Launcher.Plugin.Program/Settings.cs b/Plugins/Flow.Launcher.Plugin.Program/Settings.cs index d97ddd993..09e135d9b 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Settings.cs @@ -12,10 +12,11 @@ namespace Flow.Launcher.Plugin.Program public string[] ProgramSuffixes { get; set; } = {"appref-ms", "exe", "lnk"}; public bool EnableStartMenuSource { get; set; } = true; - public bool EnableDescription { get; set; } = false; public bool HideAppsPath { get; set; } = true; public bool EnableRegistrySource { get; set; } = true; + public bool EnablePATHSource { get; set; } = false; + public string CustomizedExplorer { get; set; } = Explorer; public string CustomizedArgs { get; set; } = ExplorerArgs; diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml index f07879465..1095eaf45 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml @@ -54,10 +54,19 @@ IsChecked="{Binding EnableDescription}" ToolTip="{DynamicResource flowlauncher_plugin_program_enable_description_tooltip}" /> + + + + _settings.EnablePATHSource; + set + { + _settings.EnablePATHSource = value; + ReIndexing(); + } + } + public string CustomizedExplorerPath { get => _settings.CustomizedExplorer; @@ -360,4 +370,4 @@ namespace Flow.Launcher.Plugin.Program.Views } } } -} \ No newline at end of file +} From e6c933851a68bf84cfde4791bdd8d547efec2aa9 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sun, 16 Oct 2022 00:32:24 +0800 Subject: [PATCH 09/16] Fix typo --- Plugins/Flow.Launcher.Plugin.Program/Main.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Main.cs b/Plugins/Flow.Launcher.Plugin.Program/Main.cs index f0a53ed77..2178c8ef5 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Main.cs @@ -102,7 +102,7 @@ namespace Flow.Launcher.Plugin.Program var b = Task.Run(() => { - Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|Win32Program index cost", IndexUwpPrograms); + Stopwatch.Normal("|Flow.Launcher.Plugin.Program.Main|UWPPRogram index cost", IndexUwpPrograms); }); if (cacheEmpty) From d90d1156548441e79a6f0d077121529e56a7e01b Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sun, 16 Oct 2022 01:24:07 +0800 Subject: [PATCH 10/16] minor fix --- Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index cb467f740..cfd190c23 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -389,7 +389,7 @@ namespace Flow.Launcher.Plugin.Program.Programs } var toFilter = new List(); - var paths = pathEnv.Split(";", StringSplitOptions.RemoveEmptyEntries).ToList().ConvertAll(x => x.ToLower()).Distinct(); + var paths = pathEnv.Split(";", StringSplitOptions.RemoveEmptyEntries).DistinctBy(p => p.ToLower()); foreach (var path in paths) { From a171addf4cee3f70fd78743549295cd345611c87 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sun, 16 Oct 2022 02:28:29 +0800 Subject: [PATCH 11/16] Disable recursive search for PATH folders --- Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index cfd190c23..b8bfbef8a 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -318,14 +318,14 @@ namespace Flow.Launcher.Plugin.Program.Programs } } - private static IEnumerable ProgramPaths(string directory, string[] suffixes) + private static IEnumerable ProgramPaths(string directory, string[] suffixes, bool recursive=true) { if (!Directory.Exists(directory)) return Enumerable.Empty(); return Directory.EnumerateFiles(directory, "*", new EnumerationOptions { - IgnoreInaccessible = true, RecurseSubdirectories = true + IgnoreInaccessible = true, RecurseSubdirectories = recursive }).Where(x => suffixes.Contains(Extension(x))); } @@ -393,7 +393,7 @@ namespace Flow.Launcher.Plugin.Program.Programs foreach (var path in paths) { - var p = ProgramPaths(path, suffixes); + var p = ProgramPaths(path, suffixes, recursive:false); toFilter.AddRange(p); } var programs = ExceptDisabledSource(toFilter.Distinct()) From afa01559b0732b6a786a76a447d76062ff073e78 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sun, 16 Oct 2022 02:40:03 +0800 Subject: [PATCH 12/16] Text key update --- Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml | 2 ++ .../Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml index 8d8cae02c..b48c7e1de 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml @@ -19,6 +19,8 @@ When enabled, Flow will load programs from the start menu Index Registry When enabled, Flow will load programs from the registry + Index PATH + When enabled, Flow will load programs from the PATH environment variable Hide app path For executable files such as UWP or lnk, hide the file path from being visible Search in Program Description diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml index 1095eaf45..d59bd8690 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml @@ -63,9 +63,9 @@ + ToolTip="{DynamicResource flowlauncher_plugin_program_index_PATH_tooltip}" /> Date: Sun, 16 Oct 2022 13:34:06 +0800 Subject: [PATCH 13/16] Change UI --- .../Views/ProgramSetting.xaml | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml index d59bd8690..2fbb5f82a 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml +++ b/Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml @@ -22,7 +22,6 @@ + - - - - - Date: Sun, 16 Oct 2022 20:18:26 +0800 Subject: [PATCH 14/16] Remove duplicate win32 programs --- Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index b8bfbef8a..f0c783d76 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -565,7 +565,7 @@ namespace Flow.Launcher.Plugin.Program.Programs autoIndexPrograms = ProgramsHasher(autoIndexPrograms); - return programs.Concat(autoIndexPrograms).Distinct().ToArray(); + return ProgramsHasher(programs.Concat(autoIndexPrograms)).ToArray(); } #if DEBUG //This is to make developer aware of any unhandled exception and add in handling. catch (Exception) From 679157949453c9299cc290b5b908fa6e2e759169 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sun, 16 Oct 2022 21:15:40 +0800 Subject: [PATCH 15/16] Use Linq --- .../Flow.Launcher.Plugin.Program/Programs/Win32.cs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index f0c783d76..656429f22 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -361,7 +361,6 @@ namespace Flow.Launcher.Plugin.Program.Programs private static IEnumerable StartMenuPrograms(string[] suffixes) { - var disabledProgramsList = Main._settings.DisabledProgramSources; var directory1 = Environment.GetFolderPath(Environment.SpecialFolder.Programs); var directory2 = Environment.GetFolderPath(Environment.SpecialFolder.CommonPrograms); @@ -381,21 +380,15 @@ namespace Flow.Launcher.Plugin.Program.Programs private static IEnumerable PATHPrograms(string[] suffixes) { - var disabledProgramsList = Main._settings.DisabledProgramSources; - - string? pathEnv = Environment.GetEnvironmentVariable("Path"); + var pathEnv = Environment.GetEnvironmentVariable("Path"); if (String.IsNullOrEmpty(pathEnv)) { return Array.Empty(); } - var toFilter = new List(); var paths = pathEnv.Split(";", StringSplitOptions.RemoveEmptyEntries).DistinctBy(p => p.ToLower()); - foreach (var path in paths) - { - var p = ProgramPaths(path, suffixes, recursive:false); - toFilter.AddRange(p); - } + var toFilter = paths.SelectMany(p => ProgramPaths(p, suffixes, recursive:false)); + var programs = ExceptDisabledSource(toFilter.Distinct()) .Select(x => Extension(x) switch { From 2672460cc888a32907eeccdcc7e079dff6b88a67 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Sun, 16 Oct 2022 23:02:35 +0800 Subject: [PATCH 16/16] Remove unused using --- Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs index 656429f22..8821ef817 100644 --- a/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs +++ b/Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs @@ -11,13 +11,9 @@ using Flow.Launcher.Infrastructure; using Flow.Launcher.Plugin.Program.Logger; using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.SharedModels; -using Flow.Launcher.Infrastructure.Logger; -using System.Collections; using System.Diagnostics; -using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch; using System.Diagnostics.CodeAnalysis; using System.Threading.Channels; -using System.Collections.ObjectModel; namespace Flow.Launcher.Plugin.Program.Programs {