mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
update method parameter style
This commit is contained in:
parent
c00d804073
commit
386737acac
1 changed files with 8 additions and 8 deletions
|
|
@ -54,7 +54,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
/// </summary>
|
||||
public static void Save()
|
||||
{
|
||||
foreach (var pluginPair in GetAllInitializedPlugins(false))
|
||||
foreach (var pluginPair in GetAllInitializedPlugins(includeFailed: false))
|
||||
{
|
||||
var savable = pluginPair.Plugin as ISavable;
|
||||
try
|
||||
|
|
@ -74,7 +74,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
public static async ValueTask DisposePluginsAsync()
|
||||
{
|
||||
// Still call dispose for all plugins even if initialization failed, so that we can clean up resources
|
||||
foreach (var pluginPair in GetAllInitializedPlugins(true))
|
||||
foreach (var pluginPair in GetAllInitializedPlugins(includeFailed: true))
|
||||
{
|
||||
await DisposePluginAsync(pluginPair);
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
public static async Task ReloadDataAsync()
|
||||
{
|
||||
await Task.WhenAll([.. GetAllInitializedPlugins(false).Select(plugin => plugin.Plugin switch
|
||||
await Task.WhenAll([.. GetAllInitializedPlugins(includeFailed: false).Select(plugin => plugin.Plugin switch
|
||||
{
|
||||
IReloadable p => Task.Run(p.ReloadData),
|
||||
IAsyncReloadable p => p.ReloadDataAsync(),
|
||||
|
|
@ -116,7 +116,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
public static async Task OpenExternalPreviewAsync(string path, bool sendFailToast = true)
|
||||
{
|
||||
await Task.WhenAll([.. GetAllInitializedPlugins(false).Select(plugin => plugin.Plugin switch
|
||||
await Task.WhenAll([.. GetAllInitializedPlugins(includeFailed: false).Select(plugin => plugin.Plugin switch
|
||||
{
|
||||
IAsyncExternalPreview p => p.OpenPreviewAsync(path, sendFailToast),
|
||||
_ => Task.CompletedTask,
|
||||
|
|
@ -125,7 +125,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
public static async Task CloseExternalPreviewAsync()
|
||||
{
|
||||
await Task.WhenAll([.. GetAllInitializedPlugins(false).Select(plugin => plugin.Plugin switch
|
||||
await Task.WhenAll([.. GetAllInitializedPlugins(includeFailed: false).Select(plugin => plugin.Plugin switch
|
||||
{
|
||||
IAsyncExternalPreview p => p.ClosePreviewAsync(),
|
||||
_ => Task.CompletedTask,
|
||||
|
|
@ -134,7 +134,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
public static async Task SwitchExternalPreviewAsync(string path, bool sendFailToast = true)
|
||||
{
|
||||
await Task.WhenAll([.. GetAllInitializedPlugins(false).Select(plugin => plugin.Plugin switch
|
||||
await Task.WhenAll([.. GetAllInitializedPlugins(includeFailed: false).Select(plugin => plugin.Plugin switch
|
||||
{
|
||||
IAsyncExternalPreview p => p.SwitchPreviewAsync(path, sendFailToast),
|
||||
_ => Task.CompletedTask,
|
||||
|
|
@ -824,7 +824,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
return true; // If version is not valid, we assume it is lesser than any existing version
|
||||
|
||||
// Get all plugins even if initialization failed so that we can check if the plugin with the same ID exists
|
||||
return GetAllInitializedPlugins(true).Any(x => x.Metadata.ID == newMetadata.ID
|
||||
return GetAllInitializedPlugins(includeFailed: true).Any(x => x.Metadata.ID == newMetadata.ID
|
||||
&& Version.TryParse(x.Metadata.Version, out var version)
|
||||
&& newVersion <= version);
|
||||
}
|
||||
|
|
@ -966,7 +966,7 @@ namespace Flow.Launcher.Core.Plugin
|
|||
// If we want to remove plugin from AllPlugins,
|
||||
// we need to dispose them so that they can release file handles
|
||||
// which can help FL to delete the plugin settings & cache folders successfully
|
||||
var pluginPairs = GetAllInitializedPlugins(true).Where(p => p.Metadata.ID == plugin.ID).ToList();
|
||||
var pluginPairs = GetAllInitializedPlugins(includeFailed: true).Where(p => p.Metadata.ID == plugin.ID).ToList();
|
||||
foreach (var pluginPair in pluginPairs)
|
||||
{
|
||||
await DisposePluginAsync(pluginPair);
|
||||
|
|
|
|||
Loading…
Reference in a new issue