@@ -89,6 +89,7 @@ private List<Result> CreateResultsFromProcesses(List<ProcessResult> processlist,
89
89
SubTitle = path ,
90
90
TitleHighlightData = StringMatcher . FuzzySearch ( termToSearch , p . ProcessName ) . MatchData ,
91
91
Score = pr . Score ,
92
+ ContextData = p . ProcessName ,
92
93
Action = ( c ) =>
93
94
{
94
95
processHelper . TryKill ( p ) ;
@@ -101,14 +102,14 @@ private List<Result> CreateResultsFromProcesses(List<ProcessResult> processlist,
101
102
102
103
// When there are multiple results AND all of them are instances of the same executable
103
104
// add a quick option to kill them all at the top of the results.
104
- var firstResult = sortedResults . FirstOrDefault ( ) ? . SubTitle ;
105
- if ( processlist . Count > 1 && ! string . IsNullOrEmpty ( termToSearch ) && sortedResults . All ( r => r . SubTitle == firstResult ) )
105
+ var firstResult = sortedResults . FirstOrDefault ( x => ! string . IsNullOrEmpty ( x . SubTitle ) ) ;
106
+ if ( processlist . Count > 1 && ! string . IsNullOrEmpty ( termToSearch ) && sortedResults . All ( r => r . SubTitle == firstResult ? . SubTitle ) )
106
107
{
107
108
sortedResults . Insert ( 1 , new Result ( )
108
109
{
109
- IcoPath = "Images/app.png" ,
110
- Title = string . Format ( _context . API . GetTranslation ( "flowlauncher_plugin_processkiller_kill_all" ) , termToSearch ) ,
111
- SubTitle = "" ,
110
+ IcoPath = firstResult ? . IcoPath ,
111
+ Title = string . Format ( _context . API . GetTranslation ( "flowlauncher_plugin_processkiller_kill_all" ) , firstResult ? . ContextData ) ,
112
+ SubTitle = string . Format ( _context . API . GetTranslation ( "flowlauncher_plugin_processkiller_kill_all_count" ) , processlist . Count ) ,
112
113
Score = 200 ,
113
114
Action = ( c ) =>
114
115
{
0 commit comments