mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
revert-image cache as dictionary, concurrent not serializable
This commit is contained in:
parent
ffa68a5a7b
commit
ca08e60308
1 changed files with 4 additions and 4 deletions
|
|
@ -14,7 +14,7 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
public static class ImageLoader
|
||||
{
|
||||
private static readonly ImageCache ImageCache = new ImageCache();
|
||||
private static BinaryStorage<ConcurrentDictionary<string, int>> _storage;
|
||||
private static BinaryStorage<Dictionary<string, int>> _storage;
|
||||
private static readonly ConcurrentDictionary<string, string> GuidToKey = new ConcurrentDictionary<string, string>();
|
||||
private static IImageHashGenerator _hashGenerator;
|
||||
private static bool EnableImageHash = true;
|
||||
|
|
@ -32,7 +32,7 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
|
||||
public static void Initialize()
|
||||
{
|
||||
_storage = new BinaryStorage<ConcurrentDictionary<string, int>>("Image");
|
||||
_storage = new BinaryStorage<Dictionary<string, int>>("Image");
|
||||
_hashGenerator = new ImageHashGenerator();
|
||||
|
||||
ImageCache.Usage = LoadStorageToConcurrentDictionary();
|
||||
|
|
@ -62,7 +62,7 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
lock (_storage)
|
||||
{
|
||||
ImageCache.Cleanup();
|
||||
_storage.Save(ImageCache.Usage);
|
||||
_storage.Save(new Dictionary<string, int>(ImageCache.Usage));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
{
|
||||
lock(_storage)
|
||||
{
|
||||
var loaded = _storage.TryLoad(new ConcurrentDictionary<string, int>());
|
||||
var loaded = _storage.TryLoad(new Dictionary<string, int>());
|
||||
|
||||
return new ConcurrentDictionary<string, int>(loaded);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue