mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #2089 from VictoriousRaptor/FixImageCache
Fix image.cache save & load
This commit is contained in:
commit
b97b56742e
7 changed files with 16 additions and 7 deletions
|
|
@ -48,6 +48,9 @@ namespace Flow.Launcher.Core.Plugin
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save json and ISavable
|
||||
/// </summary>
|
||||
public static void Save()
|
||||
{
|
||||
foreach (var plugin in AllPlugins)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
private const int permissibleFactor = 2;
|
||||
private SemaphoreSlim semaphore = new(1, 1);
|
||||
|
||||
public void Initialization(Dictionary<(string, bool), int> usage)
|
||||
public void Initialize(Dictionary<(string, bool), int> usage)
|
||||
{
|
||||
foreach (var key in usage.Keys)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ namespace Flow.Launcher.Infrastructure.Image
|
|||
|
||||
var usage = LoadStorageToConcurrentDictionary();
|
||||
|
||||
ImageCache.Initialize(usage.ToDictionary(x => x.Key, x => x.Value));
|
||||
|
||||
foreach (var icon in new[]
|
||||
{
|
||||
Constant.DefaultIcon, Constant.MissingImgIcon
|
||||
|
|
|
|||
|
|
@ -69,13 +69,11 @@ namespace Flow.Launcher
|
|||
_viewModel.ResultCopy(QueryTextBox.SelectedText);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async void OnClosing(object sender, CancelEventArgs e)
|
||||
{
|
||||
_settings.WindowTop = Top;
|
||||
_settings.WindowLeft = Left;
|
||||
_notifyIcon.Visible = false;
|
||||
_viewModel.Save();
|
||||
App.API.SaveAppAllSettings();
|
||||
e.Cancel = true;
|
||||
await PluginManager.DisposePluginsAsync();
|
||||
Notification.Uninstall();
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ namespace Flow.Launcher
|
|||
|
||||
public void SaveAppAllSettings()
|
||||
{
|
||||
SavePluginSettings();
|
||||
PluginManager.Save();
|
||||
_mainVM.Save();
|
||||
_settingsVM.Save();
|
||||
ImageLoader.Save();
|
||||
|
|
@ -158,6 +158,9 @@ namespace Flow.Launcher
|
|||
|
||||
private readonly ConcurrentDictionary<Type, object> _pluginJsonStorages = new();
|
||||
|
||||
/// <summary>
|
||||
/// Save plugin settings.
|
||||
/// </summary>
|
||||
public void SavePluginSettings()
|
||||
{
|
||||
foreach (var value in _pluginJsonStorages.Values)
|
||||
|
|
|
|||
|
|
@ -226,6 +226,7 @@ namespace Flow.Launcher
|
|||
settings.SettingWindowTop = Top;
|
||||
settings.SettingWindowLeft = Left;
|
||||
viewModel.Save();
|
||||
API.SavePluginSettings();
|
||||
}
|
||||
|
||||
private void OnCloseExecuted(object sender, ExecutedRoutedEventArgs e)
|
||||
|
|
|
|||
|
|
@ -133,6 +133,9 @@ namespace Flow.Launcher.ViewModel
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Save Flow settings. Plugins settings are not included.
|
||||
/// </summary>
|
||||
public void Save()
|
||||
{
|
||||
foreach (var vm in PluginViewModels)
|
||||
|
|
@ -143,7 +146,6 @@ namespace Flow.Launcher.ViewModel
|
|||
Settings.PluginSettings.Plugins[id].Priority = vm.Priority;
|
||||
}
|
||||
|
||||
PluginManager.Save();
|
||||
_storage.Save();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue