mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Improve code quality
This commit is contained in:
parent
97fb8d680f
commit
93af079316
1 changed files with 37 additions and 37 deletions
|
|
@ -485,6 +485,43 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
#endregion
|
||||
|
||||
#region Get Plugin List
|
||||
|
||||
public static List<PluginPair> GetAllLoadedPlugins()
|
||||
{
|
||||
return [.. _allLoadedPlugins];
|
||||
}
|
||||
|
||||
public static List<PluginPair> GetAllInitializedPlugins(bool includeFailed)
|
||||
{
|
||||
if (includeFailed)
|
||||
{
|
||||
return [.. _allInitializedPlugins.Values];
|
||||
}
|
||||
else
|
||||
{
|
||||
return [.. _allInitializedPlugins.Values
|
||||
.Where(p => !_initFailedPlugins.ContainsKey(p.Metadata.ID))];
|
||||
}
|
||||
}
|
||||
|
||||
public static List<PluginPair> GetGlobalPlugins()
|
||||
{
|
||||
return [.. _globalPlugins.Values];
|
||||
}
|
||||
|
||||
public static Dictionary<string, PluginPair> GetNonGlobalPlugins()
|
||||
{
|
||||
return _nonGlobalPlugins.ToDictionary();
|
||||
}
|
||||
|
||||
public static List<PluginPair> GetTranslationPlugins()
|
||||
{
|
||||
return [.. _translationPlugins.Where(p => !PluginModified(p.Metadata.ID))];
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Update Metadata & Get Plugin
|
||||
|
||||
public static void UpdatePluginMetadata(IReadOnlyList<Result> results, PluginMetadata metadata, Query query)
|
||||
|
|
@ -517,43 +554,6 @@ namespace Flow.Launcher.Core.Plugin
|
|||
|
||||
#endregion
|
||||
|
||||
#region Get Plugin List
|
||||
|
||||
public static List<PluginPair> GetAllLoadedPlugins()
|
||||
{
|
||||
return [.. _allLoadedPlugins];
|
||||
}
|
||||
|
||||
public static List<PluginPair> GetAllInitializedPlugins(bool containFailed)
|
||||
{
|
||||
if (containFailed)
|
||||
{
|
||||
return [.. _allInitializedPlugins.Values];
|
||||
}
|
||||
else
|
||||
{
|
||||
return [.. _allInitializedPlugins.Values
|
||||
.Where(p => !_initFailedPlugins.ContainsKey(p.Metadata.ID))];
|
||||
}
|
||||
}
|
||||
|
||||
public static List<PluginPair> GetGlobalPlugins()
|
||||
{
|
||||
return [.. _globalPlugins.Values];
|
||||
}
|
||||
|
||||
public static Dictionary<string, PluginPair> GetNonGlobalPlugins()
|
||||
{
|
||||
return _nonGlobalPlugins.ToDictionary();
|
||||
}
|
||||
|
||||
public static List<PluginPair> GetTranslationPlugins()
|
||||
{
|
||||
return [.. _translationPlugins.Where(p => !PluginModified(p.Metadata.ID))];
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Get Context Menus
|
||||
|
||||
public static List<Result> GetContextMenusForPlugin(Result result)
|
||||
|
|
|
|||
Loading…
Reference in a new issue