mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #164 from Flow-Launcher/sort_plugin_processkiller_results
Sort plugin ProcessKiller's results ascending
This commit is contained in:
commit
e204a092ba
2 changed files with 7 additions and 5 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Reference in a new issue