This commit is contained in:
Jeremy Wu 2021-02-19 21:03:23 +11:00
parent 49eb094354
commit cc48ed54a3
4 changed files with 4 additions and 7 deletions

View file

@ -748,7 +748,7 @@ namespace Flow.Launcher.ViewModel
/// <summary>
/// To avoid deadlock, this method should not called from main thread
/// </summary>
public void UpdateResultView(IReadOnlyCollection<ResultsForUpdate> resultsForUpdates)
public void UpdateResultView(IEnumerable<ResultsForUpdate> resultsForUpdates)
{
if (!resultsForUpdates.Any())
return;

View file

@ -143,7 +143,7 @@ namespace Flow.Launcher.ViewModel
/// <summary>
/// To avoid deadlock, this method should not called from main thread
/// </summary>
public void AddResults(IReadOnlyCollection<ResultsForUpdate> resultsForUpdates, CancellationToken token)
public void AddResults(IEnumerable<ResultsForUpdate> resultsForUpdates, CancellationToken token)
{
var newResults = NewResults(resultsForUpdates);
@ -189,11 +189,10 @@ namespace Flow.Launcher.ViewModel
return results.Where(r => r.Result.PluginID != resultId)
.Concat(newResults)
.OrderByDescending(r => r.Result.Score)
.Distinct()
.ToList();
}
private List<ResultViewModel> NewResults(IReadOnlyCollection<ResultsForUpdate> resultsForUpdates)
private List<ResultViewModel> NewResults(IEnumerable<ResultsForUpdate> resultsForUpdates)
{
if (!resultsForUpdates.Any())
return Results.ToList();
@ -203,7 +202,6 @@ namespace Flow.Launcher.ViewModel
return results.Where(r => r != null && !resultsForUpdates.Any(u => u.Metadata.ID == r.Result.PluginID))
.Concat(resultsForUpdates.SelectMany(u => u.Results, (u, r) => new ResultViewModel(r, _settings)))
.OrderByDescending(rv => rv.Result.Score)
.Distinct()
.ToList();
}
#endregion

View file

@ -35,7 +35,6 @@ namespace Flow.Launcher.Plugin.Explorer.Search
{
return obj.SubTitle.GetHashCode();
}
}
internal async Task<List<Result>> SearchAsync(Query query, CancellationToken token)

View file

@ -7,7 +7,7 @@
"Name": "Explorer",
"Description": "Search and manage files and folders. Explorer utilises Windows Index Search",
"Author": "Jeremy Wu",
"Version": "1.7.0",
"Version": "1.7.1",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll",