mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Use plugin cache directory
This commit is contained in:
parent
b564a39aae
commit
a845e68c98
3 changed files with 12 additions and 9 deletions
|
|
@ -10,16 +10,13 @@ namespace Flow.Launcher.Plugin.BrowserBookmark;
|
|||
|
||||
public abstract class ChromiumBookmarkLoader : IBookmarkLoader
|
||||
{
|
||||
private readonly static string ClassName = nameof(ChromiumBookmarkLoader);
|
||||
private static readonly string ClassName = nameof(ChromiumBookmarkLoader);
|
||||
|
||||
private readonly string _faviconCacheDir;
|
||||
|
||||
protected ChromiumBookmarkLoader()
|
||||
{
|
||||
_faviconCacheDir = Path.Combine(
|
||||
Path.GetDirectoryName(typeof(ChromiumBookmarkLoader).Assembly.Location),
|
||||
"FaviconCache");
|
||||
Directory.CreateDirectory(_faviconCacheDir);
|
||||
_faviconCacheDir = Main._faviconCacheDir;
|
||||
}
|
||||
|
||||
public abstract List<Bookmark> GetBookmarks();
|
||||
|
|
|
|||
|
|
@ -15,10 +15,7 @@ public abstract class FirefoxBookmarkLoaderBase : IBookmarkLoader
|
|||
|
||||
protected FirefoxBookmarkLoaderBase()
|
||||
{
|
||||
_faviconCacheDir = Path.Combine(
|
||||
Path.GetDirectoryName(typeof(FirefoxBookmarkLoaderBase).Assembly.Location),
|
||||
"FaviconCache");
|
||||
Directory.CreateDirectory(_faviconCacheDir);
|
||||
_faviconCacheDir = Main._faviconCacheDir;
|
||||
}
|
||||
|
||||
public abstract List<Bookmark> GetBookmarks();
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Controls;
|
||||
using Flow.Launcher.Infrastructure;
|
||||
using Flow.Launcher.Plugin.BrowserBookmark.Commands;
|
||||
using Flow.Launcher.Plugin.BrowserBookmark.Models;
|
||||
using Flow.Launcher.Plugin.BrowserBookmark.Views;
|
||||
|
|
@ -14,6 +15,8 @@ namespace Flow.Launcher.Plugin.BrowserBookmark;
|
|||
|
||||
public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContextMenu, IDisposable
|
||||
{
|
||||
internal static string _faviconCacheDir;
|
||||
|
||||
internal static PluginInitContext _context;
|
||||
|
||||
private static List<Bookmark> _cachedBookmarks = new();
|
||||
|
|
@ -28,6 +31,12 @@ public class Main : ISettingProvider, IPlugin, IReloadable, IPluginI18n, IContex
|
|||
|
||||
_settings = context.API.LoadSettingJsonStorage<Settings>();
|
||||
|
||||
_faviconCacheDir = Path.Combine(
|
||||
_context.CurrentPluginMetadata.PluginCacheDirectoryPath,
|
||||
"FaviconCache");
|
||||
|
||||
Helper.ValidateDirectory(_faviconCacheDir);
|
||||
|
||||
LoadBookmarksIfEnabled();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue