From 01f98b16fa9799e801333523571de8244bc90212 Mon Sep 17 00:00:00 2001 From: Ioannis G Date: Sun, 11 Oct 2020 23:40:29 +0300 Subject: [PATCH] plugin/pkiller: fix context menu results do not show the "kill all instances" context menu option when the context menu itself is triggered from the "kill all X processes" result --- .../Main.cs | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs index f675e3f45..faccc31dc 100644 --- a/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs @@ -52,21 +52,24 @@ namespace Flow.Launcher.Plugin.ProcessKiller // get all non-system processes whose file path matches that of the given result (processPath) var similarProcesses = processHelper.GetSimilarProcesses(processPath); - menuOptions.Add(new Result + if (similarProcesses.Count() > 0) { - Title = _context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_instances"), - SubTitle = processPath, - Action = _ => + menuOptions.Add(new Result { - foreach (var p in similarProcesses) + Title = _context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_instances"), + SubTitle = processPath, + Action = _ => { - processHelper.TryKill(p); - } + foreach (var p in similarProcesses) + { + processHelper.TryKill(p); + } - return true; - }, - IcoPath = processPath - }); + return true; + }, + IcoPath = processPath + }); + } return menuOptions; }