rename variable Count to CommandHistory

This commit is contained in:
Jeremy Wu 2021-04-12 17:32:48 +10:00
parent ab52859461
commit 4abddb2597
2 changed files with 6 additions and 6 deletions

View file

@ -102,7 +102,7 @@ namespace Flow.Launcher.Plugin.Shell
private List<Result> GetHistoryCmds(string cmd, Result result)
{
IEnumerable<Result> history = _settings.Count.Where(o => o.Key.Contains(cmd))
IEnumerable<Result> history = _settings.CommandHistory.Where(o => o.Key.Contains(cmd))
.OrderByDescending(o => o.Value)
.Select(m =>
{
@ -148,7 +148,7 @@ namespace Flow.Launcher.Plugin.Shell
private List<Result> ResultsFromlHistory()
{
IEnumerable<Result> history = _settings.Count.OrderByDescending(o => o.Value)
IEnumerable<Result> history = _settings.CommandHistory.OrderByDescending(o => o.Value)
.Select(m => new Result
{
Title = m.Key,

View file

@ -9,17 +9,17 @@ namespace Flow.Launcher.Plugin.Shell
public bool LeaveShellOpen { get; set; }
public bool RunAsAdministrator { get; set; } = true;
public Dictionary<string, int> Count { get; set; } = new Dictionary<string, int>();
public Dictionary<string, int> CommandHistory { get; set; } = new Dictionary<string, int>();
public void AddCmdHistory(string cmdName)
{
if (Count.ContainsKey(cmdName))
if (CommandHistory.ContainsKey(cmdName))
{
Count[cmdName] += 1;
CommandHistory[cmdName] += 1;
}
else
{
Count.Add(cmdName, 1);
CommandHistory.Add(cmdName, 1);
}
}
}