From 2d45a79aedeee41101a1b377efcd6cf22158d513 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 24 Sep 2020 07:22:55 +1000 Subject: [PATCH 1/2] sort ProcessKiller plugin's results ascending --- Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs index 22c84b20f96..f675e3f4578 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs @@ -94,12 +94,14 @@ private List CreateResultsFromProcesses(List processlist, }); } + var sortedResults = results.OrderBy(x => x.Title).ToList(); + // When there are multiple results AND all of them are instances of the same executable // add a quick option to kill them all at the top of the results. - var firstResult = results.FirstOrDefault()?.SubTitle; - if (processlist.Count > 1 && !string.IsNullOrEmpty(termToSearch) && results.All(r => r.SubTitle == firstResult)) + var firstResult = sortedResults.FirstOrDefault()?.SubTitle; + if (processlist.Count > 1 && !string.IsNullOrEmpty(termToSearch) && sortedResults.All(r => r.SubTitle == firstResult)) { - results.Insert(0, new Result() + sortedResults.Insert(1, new Result() { IcoPath = "Images/app.png", Title = string.Format(_context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_all"), termToSearch), @@ -117,7 +119,7 @@ private List CreateResultsFromProcesses(List processlist, }); } - return results; + return sortedResults; } } } From f5acb9c759a09081788bbb0b539d182b6962fd25 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Thu, 24 Sep 2020 07:23:14 +1000 Subject: [PATCH 2/2] version bump ProcessKiller plugin --- Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json b/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json index f2e1eca1265..894c49bdf6c 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/plugin.json @@ -4,7 +4,7 @@ "Name":"Process Killer", "Description":"kill running processes from Flow", "Author":"Flow-Launcher", - "Version":"1.0.0", + "Version":"1.1.0", "Language":"csharp", "Website":"https://github.com/Flow-Launcher/Flow.Launcher.Plugin.ProcessKiller", "IcoPath":"Images\\app.png",