Skip to content

Commit cb8b5f2

Browse files
committed
Merge remote-tracking branch 'origin/250320BookmarkFavicon' into 250320BookmarkFavicon
2 parents dfc9d5b + 443f17d commit cb8b5f2

File tree

1 file changed

+11
-10
lines changed
  • Plugins/Flow.Launcher.Plugin.BrowserBookmark

1 file changed

+11
-10
lines changed

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Main.cs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex
1717
{
1818
private static PluginInitContext _context;
1919

20-
private static List<Bookmark> _cachedBookmarks = new List<Bookmark>();
20+
private static List<Bookmark> _cachedBookmarks = new();
2121

2222
private static Settings _settings;
2323

@@ -117,9 +117,9 @@ public List<Result> Query(Query query)
117117
}
118118
}
119119

120-
private static Channel<byte> _refreshQueue = Channel.CreateBounded<byte>(1);
120+
private static readonly Channel<byte> _refreshQueue = Channel.CreateBounded<byte>(1);
121121

122-
private static SemaphoreSlim _fileMonitorSemaphore = new(1, 1);
122+
private static readonly SemaphoreSlim _fileMonitorSemaphore = new(1, 1);
123123

124124
private static async Task MonitorRefreshQueueAsync()
125125
{
@@ -153,12 +153,13 @@ internal static void RegisterBookmarkFile(string path)
153153
return;
154154
}
155155

156-
var watcher = new FileSystemWatcher(directory!);
157-
watcher.Filter = Path.GetFileName(path);
158-
159-
watcher.NotifyFilter = NotifyFilters.FileName |
160-
NotifyFilters.LastWrite |
161-
NotifyFilters.Size;
156+
var watcher = new FileSystemWatcher(directory!)
157+
{
158+
Filter = Path.GetFileName(path),
159+
NotifyFilter = NotifyFilters.FileName |
160+
NotifyFilters.LastWrite |
161+
NotifyFilters.Size
162+
};
162163

163164
watcher.Changed += static (_, _) =>
164165
{
@@ -207,7 +208,7 @@ public List<Result> LoadContextMenus(Result selectedResult)
207208
{
208209
return new List<Result>()
209210
{
210-
new Result
211+
new()
211212
{
212213
Title = _context.API.GetTranslation("flowlauncher_plugin_browserbookmark_copyurl_title"),
213214
SubTitle = _context.API.GetTranslation("flowlauncher_plugin_browserbookmark_copyurl_subtitle"),

0 commit comments

Comments
 (0)