From 935d41dc265972c433f599a5fbfdff0acd798542 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Fri, 23 Jan 2026 16:10:01 +0800
Subject: [PATCH] Ensure combability of glyph setter
---
Flow.Launcher.Plugin/Result.cs | 19 +++++++++++++++++--
Flow.Launcher/Storage/QueryHistory.cs | 2 +-
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/Flow.Launcher.Plugin/Result.cs b/Flow.Launcher.Plugin/Result.cs
index 1682c4d79..e944081f9 100644
--- a/Flow.Launcher.Plugin/Result.cs
+++ b/Flow.Launcher.Plugin/Result.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
@@ -164,10 +164,25 @@ namespace Flow.Launcher.Plugin
[JsonIgnore]
public IconDelegate BadgeIcon = null;
+ private GlyphInfo _glyph;
+
///
/// Information for Glyph Icon (Prioritized than IcoPath/Icon if user enable Glyph Icons)
///
- public GlyphInfo Glyph { get; set; }
+ public GlyphInfo Glyph
+ {
+ get => _glyph;
+ init => _glyph = value;
+ }
+
+ ///
+ /// Set the Glyph Icon
+ ///
+ ///
+ public void SetGlyph(GlyphInfo glyph)
+ {
+ _glyph = glyph;
+ }
///
/// An action to take in the form of a function call when the result has been selected.
diff --git a/Flow.Launcher/Storage/QueryHistory.cs b/Flow.Launcher/Storage/QueryHistory.cs
index 0f4d97677..7bf948399 100644
--- a/Flow.Launcher/Storage/QueryHistory.cs
+++ b/Flow.Launcher/Storage/QueryHistory.cs
@@ -78,7 +78,7 @@ namespace Flow.Launcher.Storage
if (existingHistoryItem.Glyph?.Glyph != result.Glyph?.Glyph
|| existingHistoryItem.Glyph?.FontFamily != result.Glyph?.FontFamily)
- existingHistoryItem.Glyph = result.Glyph;
+ existingHistoryItem.SetGlyph(result.Glyph);
}
else
{