mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
update IcoPath if existing is different to the selected
This commit is contained in:
parent
94ebbab68a
commit
25037e3f5f
1 changed files with 9 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
|
|
@ -45,6 +45,11 @@ namespace Flow.Launcher.Storage
|
|||
Items.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Records a result into the last-opened history list (<see cref="LastOpenedHistoryItems"/>).
|
||||
/// This will also update the IcoPath if existing history item has one that is different.
|
||||
/// </summary>
|
||||
/// <param name="result">The result to add to history. Must have a non-empty <see cref="Result.OriginQuery"/>.<see cref="Query.TrimmedQuery"/>.</param>
|
||||
public void Add(Result result)
|
||||
{
|
||||
if (string.IsNullOrEmpty(result.OriginQuery.TrimmedQuery)) return;
|
||||
|
|
@ -63,6 +68,9 @@ namespace Flow.Launcher.Storage
|
|||
TryGetLastOpenedHistoryResult(result, out var existingHistoryItem))
|
||||
{
|
||||
existingHistoryItem.ExecutedDateTime = DateTime.Now;
|
||||
|
||||
if (existingHistoryItem.IcoPath != result.IcoPath)
|
||||
existingHistoryItem.IcoPath = result.IcoPath;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue