mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
sort ProcessKiller plugin's results ascending
This commit is contained in:
parent
ec5f7275de
commit
2d45a79aed
1 changed files with 6 additions and 4 deletions
|
|
@ -94,12 +94,14 @@ namespace Flow.Launcher.Plugin.ProcessKiller
|
|||
});
|
||||
}
|
||||
|
||||
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 @@ namespace Flow.Launcher.Plugin.ProcessKiller
|
|||
});
|
||||
}
|
||||
|
||||
return results;
|
||||
return sortedResults;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue