File tree Expand file tree Collapse file tree 3 files changed +6
-9
lines changed
Flow.Launcher.Core/Plugin
Flow.Launcher.Infrastructure/UserSettings Expand file tree Collapse file tree 3 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 1
- using System ;
1
+ using System ;
2
2
using System . Collections . Generic ;
3
3
using System . Linq ;
4
4
using System . IO ;
9
9
10
10
namespace Flow . Launcher . Core . Plugin
11
11
{
12
-
13
12
internal abstract class PluginConfig
14
13
{
15
14
/// <summary>
@@ -112,7 +111,7 @@ private static PluginMetadata GetPluginMetadata(string pluginDirectory)
112
111
metadata = JsonSerializer . Deserialize < PluginMetadata > ( File . ReadAllText ( configPath ) ) ;
113
112
metadata . PluginDirectory = pluginDirectory ;
114
113
// for plugins which doesn't has ActionKeywords key
115
- metadata . ActionKeywords = metadata . ActionKeywords ?? new List < string > { metadata . ActionKeyword } ;
114
+ metadata . ActionKeywords ??= new List < string > { metadata . ActionKeyword } ;
116
115
// for plugin still use old ActionKeyword
117
116
metadata . ActionKeyword = metadata . ActionKeywords ? [ 0 ] ;
118
117
}
@@ -137,4 +136,4 @@ private static PluginMetadata GetPluginMetadata(string pluginDirectory)
137
136
return metadata ;
138
137
}
139
138
}
140
- }
139
+ }
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
81
81
metadata . PluginCacheDirectoryPath = Path . Combine ( DataLocation . PluginCacheDirectory , assemblyName ) ;
82
82
}
83
83
#if DEBUG
84
- catch ( Exception e )
84
+ catch ( Exception )
85
85
{
86
86
throw ;
87
87
}
@@ -117,7 +117,7 @@ public static IEnumerable<PluginPair> DotNetPlugins(List<PluginMetadata> source)
117
117
118
118
if ( erroredPlugins . Count > 0 )
119
119
{
120
- var errorPluginString = String . Join ( Environment . NewLine , erroredPlugins ) ;
120
+ var errorPluginString = string . Join ( Environment . NewLine , erroredPlugins ) ;
121
121
122
122
var errorMessage = "The following "
123
123
+ ( erroredPlugins . Count > 1 ? "plugins have " : "plugin has " )
Original file line number Diff line number Diff line change @@ -32,10 +32,8 @@ public void UpdatePluginSettings(List<PluginMetadata> metadatas)
32
32
{
33
33
foreach ( var metadata in metadatas )
34
34
{
35
- if ( Plugins . ContainsKey ( metadata . ID ) )
35
+ if ( Plugins . TryGetValue ( metadata . ID , out var settings ) )
36
36
{
37
- var settings = Plugins [ metadata . ID ] ;
38
-
39
37
if ( string . IsNullOrEmpty ( settings . Version ) )
40
38
settings . Version = metadata . Version ;
41
39
You can’t perform that action at this time.
0 commit comments