Rename to favicon

This commit is contained in:
Jack251970 2025-06-05 10:21:24 +08:00
parent 69dd038311
commit 94b8a66db7
5 changed files with 12 additions and 12 deletions

View file

@ -52,12 +52,12 @@ public abstract class ChromiumBookmarkLoader : IBookmarkLoader
var profileBookmarks = LoadBookmarksFromFile(bookmarkPath, source);
// Load favicons after loading bookmarks
if (Main._settings.EnableFavoriteIcons)
if (Main._settings.EnableFavicons)
{
var faviconDbPath = Path.Combine(profile, "Favicons");
if (File.Exists(faviconDbPath))
{
Main._context.API.StopwatchLogInfo(ClassName, $"Load {profileBookmarks.Count} favorite icons cost", () =>
Main._context.API.StopwatchLogInfo(ClassName, $"Load {profileBookmarks.Count} favicons cost", () =>
{
LoadFaviconsFromDb(faviconDbPath, profileBookmarks);
});
@ -157,7 +157,7 @@ public abstract class ChromiumBookmarkLoader : IBookmarkLoader
try
{
// Since some bookmarks may have same favorite icon id, we need to record them to avoid duplicates
// Since some bookmarks may have same favicon id, we need to record them to avoid duplicates
var savedPaths = new ConcurrentDictionary<string, bool>();
// Get favicons based on bookmarks concurrently
@ -202,7 +202,7 @@ public abstract class ChromiumBookmarkLoader : IBookmarkLoader
var faviconPath = Path.Combine(_faviconCacheDir, $"chromium_{domain}_{iconId}.png");
// Filter out duplicate favorite icons
// Filter out duplicate favicons
if (savedPaths.TryAdd(faviconPath, true))
{
SaveBitmapData(imageData, faviconPath);

View file

@ -78,12 +78,12 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader
.ToList();
// Load favicons after loading bookmarks
if (Main._settings.EnableFavoriteIcons)
if (Main._settings.EnableFavicons)
{
var faviconDbPath = Path.Combine(Path.GetDirectoryName(placesPath), "favicons.sqlite");
if (File.Exists(faviconDbPath))
{
Main._context.API.StopwatchLogInfo(ClassName, $"Load {bookmarks.Count} favorite icons cost", () =>
Main._context.API.StopwatchLogInfo(ClassName, $"Load {bookmarks.Count} favicons cost", () =>
{
LoadFaviconsFromDb(faviconDbPath, bookmarks);
});
@ -144,7 +144,7 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader
try
{
// Since some bookmarks may have same favorite icon id, we need to record them to avoid duplicates
// Since some bookmarks may have same favicon id, we need to record them to avoid duplicates
var savedPaths = new ConcurrentDictionary<string, bool>();
// Get favicons based on bookmarks concurrently
@ -198,7 +198,7 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader
faviconPath = Path.Combine(_faviconCacheDir, $"firefox_{domain}.png");
}
// Filter out duplicate favorite icons
// Filter out duplicate favicons
if (savedPaths.TryAdd(faviconPath, true))
{
SaveBitmapData(imageData, faviconPath);

View file

@ -27,6 +27,6 @@
<system:String x:Key="flowlauncher_plugin_browserbookmark_browserEngine">Browser Engine</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_guideMessage01">If you are not using Chrome, Firefox or Edge, or you are using their portable version, you need to add bookmarks data directory and select correct browser engine to make this plugin work.</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_guideMessage02">For example: Brave's engine is Chromium; and its default bookmarks data location is: "%LOCALAPPDATA%\BraveSoftware\Brave-Browser\UserData". For Firefox engine, the bookmarks directory is the userdata folder contains the places.sqlite file.</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_enable_favorite_icons">Load favicons (can be time consuming during startup)</system:String>
<system:String x:Key="flowlauncher_plugin_browserbookmark_enable_favicons">Load favicons (can be time consuming during startup)</system:String>
</ResourceDictionary>

View file

@ -8,7 +8,7 @@ public class Settings : BaseModel
public string BrowserPath { get; set; }
public bool EnableFavoriteIcons { get; set; } = false;
public bool EnableFavicons { get; set; } = false;
public bool LoadChromeBookmark { get; set; } = true;
public bool LoadFirefoxBookmark { get; set; } = true;

View file

@ -97,7 +97,7 @@
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Content="{DynamicResource flowlauncher_plugin_browserbookmark_enable_favorite_icons}"
IsChecked="{Binding Settings.EnableFavoriteIcons}" />
Content="{DynamicResource flowlauncher_plugin_browserbookmark_enable_favicons}"
IsChecked="{Binding Settings.EnableFavicons}" />
</Grid>
</UserControl>