Skip to content

Commit

Permalink
zero score for Putty settings result
Browse files Browse the repository at this point in the history
  • Loading branch information
jjw24 committed Jul 7, 2021
1 parent d8e2c43 commit f0b7efb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Flow.Launcher.Plugin.Putty.Test/PluginTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Flow.Launcher.Plugin.Putty.Test
public class PluginTest
{
private const string Keyword = "pt";
private readonly Result _defaultPuttyResultItem = new Result { Title = "putty.exe", IcoPath = "logo.png", SubTitle = "Launch Clean Putty" };
private readonly Result _defaultPuttyResultItem = new Result { Title = "Settings", IcoPath = "logo.png", SubTitle = "Launch Clean Putty" };

[Test]
public void Query_returns_only_Putty_as_result_with_empty_searchquery()
Expand Down
8 changes: 4 additions & 4 deletions Flow.Launcher.Plugin.Putty/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public List<Result> Query(Query query)
/// </summary>
/// <returns>A Result object containing the PuttySession identifier and its connection string</returns>
private Result CreateResult(
string title = "putty.exe", string subTitle = "Open Putty", int score = 50, PuttySession puttySession = null)
string title = "Settings", string subTitle = "Open Putty configurations", int score = 50, PuttySession puttySession = null)
{
if (puttySession != null && string.IsNullOrEmpty(puttySession.Hostname))
return new Result
Expand All @@ -180,8 +180,8 @@ public List<Result> Query(Query query)
Title = title,
SubTitle = subTitle,
IcoPath = "icon.png",
Action = context => title != "putty.exe" ? LaunchPuttySession(title, puttySession) : LaunchPuttySession(string.Empty),//load Putty instead,
Score = score
Action = context => title != "Settings" ? LaunchPuttySession(title, puttySession) : LaunchPuttySession(string.Empty),//load Putty instead,
Score = title != "Settings" ? score : 0
};
}

Expand All @@ -196,7 +196,7 @@ private bool LaunchPuttySession(string session, PuttySession puttySession = null
var puttyPath = settings.PuttyPath;

if (string.IsNullOrEmpty(settings.PuttyPath))
puttyPath = "putty.exe";
puttyPath = "Settings";

var p = new Process { StartInfo = { FileName = puttyPath } };

Expand Down
2 changes: 1 addition & 1 deletion Flow.Launcher.Plugin.Putty/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name": "Putty",
"Description": "Launch Putty Sessions",
"Author":"Konstantin Zaitcev, Kai Eichinger (@cH40zLord)",
"Version":"2.1.2",
"Version":"2.1.3",
"Language": "csharp",
"Website": "https://github.com/jjw24/Flow.Launcher.Plugin.Putty",
"ExecuteFileName": "Flow.Launcher.Plugin.Putty.dll",
Expand Down

0 comments on commit f0b7efb

Please sign in to comment.