results and query update fixes

This commit is contained in:
AT
2019-12-14 00:06:13 +02:00
parent be77bf94aa
commit ced0faf916
4 changed files with 50 additions and 37 deletions

View File

@@ -248,6 +248,10 @@ namespace Wox.ViewModel
}
}
/// <summary>
/// Update the results collection with new results, try to keep identical results
/// </summary>
/// <param name="newItems"></param>
public void Update(List<ResultViewModel> newItems)
{
int newCount = newItems.Count;
@@ -259,7 +263,7 @@ namespace Wox.ViewModel
ResultViewModel oldResult = this[i];
ResultViewModel newResult = newItems[i];
if (!oldResult.Equals(newResult))
{
{ // result is not the same update it in the current index
this[i] = newResult;
}
else if (oldResult.Result.Score != newResult.Result.Score)