From 0673d07c2a14a6595d4c495c1ab7b3fde3395782 Mon Sep 17 00:00:00 2001
From: Jack251970 <1160210343@qq.com>
Date: Thu, 1 May 2025 13:23:22 +0800
Subject: [PATCH] Improve code comments & Make classes internal
---
Flow.Launcher/Storage/TopMostRecord.cs | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/Flow.Launcher/Storage/TopMostRecord.cs b/Flow.Launcher/Storage/TopMostRecord.cs
index d604eabc1..7c45bcf66 100644
--- a/Flow.Launcher/Storage/TopMostRecord.cs
+++ b/Flow.Launcher/Storage/TopMostRecord.cs
@@ -34,7 +34,7 @@ namespace Flow.Launcher.Storage
}
catch
{
- // Ignored
+ // Ignored - Flow will delete the old data during next startup
}
_topMostRecord = _topMostRecordStorage.Load();
}
@@ -52,7 +52,7 @@ namespace Flow.Launcher.Storage
}
catch
{
- // Ignored
+ // Ignored - Flow will delete the old data during next startup
}
Save();
}
@@ -84,7 +84,10 @@ namespace Flow.Launcher.Storage
}
}
- public class TopMostRecord
+ ///
+ /// Old data structure to support only one top most record for the same query
+ ///
+ internal class TopMostRecord
{
[JsonInclude]
public ConcurrentDictionary records { get; private set; } = new();
@@ -135,7 +138,10 @@ namespace Flow.Launcher.Storage
}
}
- public class MultipleTopMostRecord
+ ///
+ /// New data structure to support multiple top most records for the same query
+ ///
+ internal class MultipleTopMostRecord
{
[JsonInclude]
[JsonConverter(typeof(ConcurrentDictionaryConcurrentBagConverter))]
@@ -246,7 +252,7 @@ namespace Flow.Launcher.Storage
///
/// Because ConcurrentBag does not support serialization, we need to convert it to a List
///
- public class ConcurrentDictionaryConcurrentBagConverter : JsonConverter>>
+ internal class ConcurrentDictionaryConcurrentBagConverter : JsonConverter>>
{
public override ConcurrentDictionary> Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
@@ -270,7 +276,7 @@ namespace Flow.Launcher.Storage
}
}
- public class Record
+ internal class Record
{
public string Title { get; init; }
public string SubTitle { get; init; }