Skip to content

Commit 697cc7f

Browse files
committed
formatting
1 parent 06b9b0a commit 697cc7f

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class Main : ISettingProvider, IPlugin, IAsyncReloadable, IPluginI18n, IC
2020
{
2121
internal static PluginInitContext Context { get; set; } = null!;
2222
private static Settings _settings = null!;
23-
23+
2424
private BookmarkLoaderService _bookmarkLoader = null!;
2525
private FaviconService _faviconService = null!;
2626
private BookmarkWatcherService _bookmarkWatcher = null!;
@@ -38,7 +38,7 @@ public void Init(PluginInitContext context)
3838
_settings.CustomBrowsers.CollectionChanged += OnCustomBrowsersChanged;
3939

4040
var tempPath = SetupTempDirectory();
41-
41+
4242
_bookmarkLoader = new BookmarkLoaderService(Context, _settings, tempPath);
4343
_faviconService = new FaviconService(Context, _settings, tempPath);
4444
_bookmarkWatcher = new BookmarkWatcherService();
@@ -78,7 +78,7 @@ public List<Result> Query(Query query)
7878
.Select(b =>
7979
{
8080
var match = Context.API.FuzzySearch(search, b.Name);
81-
if(!match.IsSearchPrecisionScoreMet())
81+
if (!match.IsSearchPrecisionScoreMet())
8282
match = Context.API.FuzzySearch(search, b.Url);
8383
return (b, match);
8484
})
@@ -90,7 +90,7 @@ public List<Result> Query(Query query)
9090

9191
return bookmarks.Select(b => CreateResult(b, 0)).ToList();
9292
}
93-
93+
9494
private Result CreateResult(Bookmark bookmark, int score) => new()
9595
{
9696
Title = bookmark.Name,
@@ -107,19 +107,19 @@ public List<Result> Query(Query query)
107107
ContextData = bookmark.Url
108108
};
109109

110-
public async Task ReloadDataAsync()
110+
public async Task ReloadDataAsync()
111111
{
112112
var (bookmarks, discoveredFiles) = await _bookmarkLoader.LoadBookmarksAsync(_cancellationTokenSource.Token);
113-
113+
114114
// Atomically swap the list. This prevents the Query method from seeing a partially loaded list.
115115
Volatile.Write(ref _bookmarks, bookmarks);
116116

117117
_bookmarkWatcher.UpdateWatchers(discoveredFiles);
118-
118+
119119
// Fire and forget favicon processing to not block the UI
120120
_ = _faviconService.ProcessBookmarkFavicons(_bookmarks, _cancellationTokenSource.Token);
121121
}
122-
122+
123123
private void OnSettingsPropertyChanged(object? sender, PropertyChangedEventArgs e)
124124
{
125125
if (e.PropertyName is nameof(Settings.LoadFirefoxBookmark))
@@ -134,7 +134,7 @@ private void OnCustomBrowsersChanged(object? sender, NotifyCollectionChangedEven
134134
StartFirefoxBookmarkTimer();
135135
_ = ReloadDataAsync();
136136
}
137-
137+
138138
private void OnBookmarkFileChanged()
139139
{
140140
_ = ReloadDataAsync();
@@ -202,25 +202,25 @@ private async Task ReloadFirefoxBookmarksAsync()
202202

203203
var newFirefoxBookmarks = successfulResults.SelectMany(r => r.Bookmarks).ToList();
204204
var successfulLoaderNames = successfulResults.Select(r => r.Loader.Name).ToHashSet();
205-
205+
206206
var currentBookmarks = Volatile.Read(ref _bookmarks);
207207

208208
var otherBookmarks = currentBookmarks.Where(b => !successfulLoaderNames.Any(name => b.Source.StartsWith(name, StringComparison.OrdinalIgnoreCase)));
209209

210210
var newBookmarkList = otherBookmarks.Concat(newFirefoxBookmarks).Distinct().ToList();
211211

212212
Volatile.Write(ref _bookmarks, newBookmarkList);
213-
213+
214214
Context.API.LogInfo(nameof(Main), $"Periodic reload complete. Loaded {newFirefoxBookmarks.Count} Firefox bookmarks from {successfulLoaderNames.Count} sources.");
215-
215+
216216
_ = _faviconService.ProcessBookmarkFavicons(newFirefoxBookmarks, _cancellationTokenSource.Token);
217217
}
218218

219219
public Control CreateSettingPanel()
220220
{
221221
return new Views.SettingsControl(_settings);
222222
}
223-
223+
224224
public string GetTranslatedPluginTitle()
225225
{
226226
return Localize.flowlauncher_plugin_browserbookmark_plugin_name();
@@ -230,12 +230,12 @@ public string GetTranslatedPluginDescription()
230230
{
231231
return Localize.flowlauncher_plugin_browserbookmark_plugin_description();
232232
}
233-
233+
234234
public List<Result> LoadContextMenus(Result selectedResult)
235235
{
236236
if (selectedResult.ContextData is not string url)
237237
return new List<Result>();
238-
238+
239239
return new List<Result>
240240
{
241241
new()
@@ -246,11 +246,11 @@ public List<Result> LoadContextMenus(Result selectedResult)
246246
IcoPath = @"Images\copylink.png",
247247
Action = _ =>
248248
{
249-
try
249+
try
250250
{
251251
Context.API.CopyToClipboard(url);
252252
return true;
253-
}
253+
}
254254
catch(Exception ex)
255255
{
256256
Context.API.LogException(nameof(Main), "Failed to copy URL to clipboard", ex);
@@ -261,7 +261,7 @@ public List<Result> LoadContextMenus(Result selectedResult)
261261
}
262262
};
263263
}
264-
264+
265265
public void Dispose()
266266
{
267267
_settings.PropertyChanged -= OnSettingsPropertyChanged;

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Services/ChromiumBookmarkLoader.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public async IAsyncEnumerable<Bookmark> GetBookmarksAsync([EnumeratorCancellatio
3434
yield break;
3535

3636
var profileDirectories = BrowserDetector.GetChromiumProfileDirectories(_browserDataPath);
37-
37+
3838
foreach (var profilePath in profileDirectories)
3939
{
4040
cancellationToken.ThrowIfCancellationRequested();
@@ -50,13 +50,13 @@ public async IAsyncEnumerable<Bookmark> GetBookmarksAsync([EnumeratorCancellatio
5050
{
5151
await using var stream = File.OpenRead(bookmarkPath);
5252
using var jsonDocument = await JsonDocument.ParseAsync(stream, cancellationToken: cancellationToken);
53-
53+
5454
if (jsonDocument.RootElement.TryGetProperty("roots", out var rootElement))
5555
{
5656
bookmarks.AddRange(EnumerateBookmarks(rootElement, source, profilePath));
5757
}
5858
}
59-
catch(JsonException ex)
59+
catch (JsonException ex)
6060
{
6161
_logException(nameof(ChromiumBookmarkLoader), $"Failed to parse bookmarks file for {_browserName}: {bookmarkPath}", ex);
6262
}
@@ -89,7 +89,7 @@ private void EnumerateFolderBookmark(JsonElement folderElement, ICollection<Book
8989
{
9090
if (!folderElement.TryGetProperty("children", out var childrenElement))
9191
return;
92-
92+
9393
foreach (var subElement in childrenElement.EnumerateArray())
9494
{
9595
if (subElement.TryGetProperty("type", out var type))

0 commit comments

Comments
 (0)