Skip to content

Commit 01f98b1

Browse files
committed
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
1 parent 82ebbcb commit 01f98b1

File tree

1 file changed

+14
-11
lines changed
  • Plugins/Flow.Launcher.Plugin.ProcessKiller

1 file changed

+14
-11
lines changed

Plugins/Flow.Launcher.Plugin.ProcessKiller/Main.cs

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,24 @@ public List<Result> LoadContextMenus(Result result)
5252
// get all non-system processes whose file path matches that of the given result (processPath)
5353
var similarProcesses = processHelper.GetSimilarProcesses(processPath);
5454

55-
menuOptions.Add(new Result
55+
if (similarProcesses.Count() > 0)
5656
{
57-
Title = _context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_instances"),
58-
SubTitle = processPath,
59-
Action = _ =>
57+
menuOptions.Add(new Result
6058
{
61-
foreach (var p in similarProcesses)
59+
Title = _context.API.GetTranslation("flowlauncher_plugin_processkiller_kill_instances"),
60+
SubTitle = processPath,
61+
Action = _ =>
6262
{
63-
processHelper.TryKill(p);
64-
}
63+
foreach (var p in similarProcesses)
64+
{
65+
processHelper.TryKill(p);
66+
}
6567

66-
return true;
67-
},
68-
IcoPath = processPath
69-
});
68+
return true;
69+
},
70+
IcoPath = processPath
71+
});
72+
}
7073

7174
return menuOptions;
7275
}

0 commit comments

Comments
 (0)