Skip to content

Commit 2af1f79

Browse files
authored
Merge pull request #326 from Flow-Launcher/dev
Release 1.7.1
2 parents 1c39377 + 6a31868 commit 2af1f79

File tree

21 files changed

+74
-58
lines changed

21 files changed

+74
-58
lines changed

Flow.Launcher.Core/Plugin/JsonPRCModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
using System.Collections.Generic;
1717
using System.Linq;
18+
using System.Text.Json.Serialization;
1819
using Flow.Launcher.Plugin;
1920

2021
namespace Flow.Launcher.Core.Plugin
@@ -42,6 +43,7 @@ public class JsonRPCResponseModel : JsonRPCModelBase
4243

4344
public class JsonRPCQueryResponseModel : JsonRPCResponseModel
4445
{
46+
[JsonPropertyName("result")]
4547
public new List<JsonRPCResult> Result { get; set; }
4648
}
4749

Flow.Launcher.Core/Plugin/JsonRPCPlugin.cs

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -147,47 +147,42 @@ protected string Execute(ProcessStartInfo startInfo)
147147
{
148148
try
149149
{
150-
using (var process = Process.Start(startInfo))
150+
using var process = Process.Start(startInfo);
151+
if (process == null)
151152
{
152-
if (process != null)
153+
Log.Error("|JsonRPCPlugin.Execute|Can't start new process");
154+
return string.Empty;
155+
}
156+
157+
using var standardOutput = process.StandardOutput;
158+
var result = standardOutput.ReadToEnd();
159+
if (string.IsNullOrEmpty(result))
160+
{
161+
using (var standardError = process.StandardError)
153162
{
154-
using (var standardOutput = process.StandardOutput)
163+
var error = standardError.ReadToEnd();
164+
if (!string.IsNullOrEmpty(error))
155165
{
156-
var result = standardOutput.ReadToEnd();
157-
if (string.IsNullOrEmpty(result))
158-
{
159-
using (var standardError = process.StandardError)
160-
{
161-
var error = standardError.ReadToEnd();
162-
if (!string.IsNullOrEmpty(error))
163-
{
164-
Log.Error($"|JsonRPCPlugin.Execute|{error}");
165-
return string.Empty;
166-
}
167-
else
168-
{
169-
Log.Error("|JsonRPCPlugin.Execute|Empty standard output and standard error.");
170-
return string.Empty;
171-
}
172-
}
173-
}
174-
else if (result.StartsWith("DEBUG:"))
175-
{
176-
MessageBox.Show(new Form { TopMost = true }, result.Substring(6));
177-
return string.Empty;
178-
}
179-
else
180-
{
181-
return result;
182-
}
166+
Log.Error($"|JsonRPCPlugin.Execute|{error}");
167+
return string.Empty;
168+
}
169+
else
170+
{
171+
Log.Error("|JsonRPCPlugin.Execute|Empty standard output and standard error.");
172+
return string.Empty;
183173
}
184-
}
185-
else
186-
{
187-
Log.Error("|JsonRPCPlugin.Execute|Can't start new process");
188-
return string.Empty;
189174
}
190175
}
176+
else if (result.StartsWith("DEBUG:"))
177+
{
178+
MessageBox.Show(new Form { TopMost = true }, result.Substring(6));
179+
return string.Empty;
180+
}
181+
else
182+
{
183+
return result;
184+
}
185+
191186
}
192187
catch (Exception e)
193188
{

Flow.Launcher.Core/Plugin/PluginManager.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ public static async Task<List<Result>> QueryForPlugin(PluginPair pair, Query que
183183
throw new ArgumentOutOfRangeException();
184184
}
185185
token.ThrowIfCancellationRequested();
186+
if (results == null)
187+
return results;
186188
UpdatePluginMetadata(results, metadata, query);
187189

188190
metadata.QueryCount += 1;

Flow.Launcher/Flow.Launcher.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@
6666
<Content Include="Images\*.svg">
6767
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
6868
</Content>
69+
<Content Include="Images\*.ico">
70+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
71+
</Content>
6972
</ItemGroup>
7073

7174
<ItemGroup>

Flow.Launcher/Images/app.ico

114 KB
Binary file not shown.

Flow.Launcher/Languages/sk.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
<!--Setting Plugin-->
4141
<system:String x:Key="plugin">Plugin</system:String>
4242
<system:String x:Key="browserMorePlugins">Nájsť ďalšie pluginy</system:String>
43-
<system:String x:Key="enable">Povoliť</system:String>
44-
<system:String x:Key="disable">Zakázať</system:String>
43+
<system:String x:Key="enable">Povolené</system:String>
44+
<system:String x:Key="disable">Zakázané</system:String>
4545
<system:String x:Key="actionKeywords">Skratka akcie</system:String>
4646
<system:String x:Key="currentActionKeywords">Aktuálna akcia skratky:</system:String>
4747
<system:String x:Key="newActionKeyword">Nová akcia skratky:</system:String>

Flow.Launcher/PublicAPIInstance.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ public void RestartApp()
6161
// which will cause ungraceful exit
6262
SaveAppAllSettings();
6363

64+
// Restart requires Squirrel's Update.exe to be present in the parent folder,
65+
// it is only published from the project's release pipeline. When debugging without it,
66+
// the project may not restart or just terminates. This is expected.
6467
UpdateManager.RestartApp(Constant.ApplicationFileName);
6568
}
6669

Flow.Launcher/SettingWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
1212
x:Class="Flow.Launcher.SettingWindow"
1313
mc:Ignorable="d"
14-
Icon="Images\app.png"
14+
Icon="Images\app.ico"
1515
Title="{DynamicResource flowlauncher_settings}"
1616
ResizeMode="NoResize"
1717
WindowStartupLocation="CenterScreen"

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ private void QueryContextMenu()
363363
}
364364

365365
if (!match.IsSearchPrecisionScoreMet()) return false;
366-
366+
367367
r.Score = match.Score;
368368
return true;
369369

@@ -512,7 +512,7 @@ async Task QueryTask(PluginPair plugin)
512512
await Task.Yield();
513513

514514
var results = await PluginManager.QueryForPlugin(plugin, query, currentCancellationToken);
515-
if (!currentCancellationToken.IsCancellationRequested)
515+
if (!currentCancellationToken.IsCancellationRequested && results != null)
516516
_resultsUpdateQueue.Post(new ResultsForUpdate(results, plugin.Metadata, query,
517517
currentCancellationToken));
518518
}

Plugins/Flow.Launcher.Plugin.Calculator/Languages/sk.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<system:String x:Key="flowlauncher_plugin_caculator_plugin_description">Spracúva matematické operácie.(Skúste 5*3-2 vo flowlauncheri)</system:String>
77
<system:String x:Key="flowlauncher_plugin_calculator_not_a_number">Nie je číslo (NaN)</system:String>
88
<system:String x:Key="flowlauncher_plugin_calculator_expression_not_complete">Nesprávny alebo neúplný výraz (Nezabudli ste na zátvorky?)</system:String>
9-
<system:String x:Key="flowlauncher_plugin_calculator_copy_number_to_clipboard">Kopírovať toto číslo do schránky</system:String>
9+
<system:String x:Key="flowlauncher_plugin_calculator_copy_number_to_clipboard">Kopírovať výsledok do schránky</system:String>
1010
<system:String x:Key="flowlauncher_plugin_calculator_output_decimal_seperator">Oddeľovač des. miest</system:String>
1111
<system:String x:Key="flowlauncher_plugin_calculator_output_decimal_seperator_help">Oddeľovač desatinných miest použitý vo výsledku.</system:String>
1212
<system:String x:Key="flowlauncher_plugin_calculator_decimal_seperator_use_system_locale">Použiť podľa systému</system:String>

0 commit comments

Comments
 (0)