Skip to content

Commit 51481d7

Browse files
committed
simplify if condition for hide app path
1 parent dbf3f1e commit 51481d7

File tree

3 files changed

+3
-27
lines changed

3 files changed

+3
-27
lines changed

Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<system:String x:Key="flowlauncher_plugin_program_index_start_tooltip">When enabled, Flow will load programs from the start menu</system:String>
1818
<system:String x:Key="flowlauncher_plugin_program_index_registry">Index Registry</system:String>
1919
<system:String x:Key="flowlauncher_plugin_program_index_registry_tooltip">When enabled, Flow will load programs from the registry</system:String>
20-
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath">Hide Apps path</system:String>
20+
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath">Hide app path</system:String>
2121
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath_tooltip">For executable files such as UWP or lnk, hide the file path from being visible</system:String>
2222
<system:String x:Key="flowlauncher_plugin_program_enable_description">Search in Program Description</system:String>
2323
<system:String x:Key="flowlauncher_plugin_program_enable_description_tooltip">Disabling this will also stop Flow from searching via the program desciption</system:String>

Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public Result Result(string query, IPublicAPI api)
314314
var result = new Result
315315
{
316316
Title = title,
317-
SubTitle = HideLnkPath(),
317+
SubTitle = Main._settings.EnableHideLnkPath ? string.Empty : Package.Location,
318318
Icon = Logo,
319319
Score = matchResult.Score,
320320
TitleHighlightData = matchResult.MatchData,
@@ -351,18 +351,6 @@ public Result Result(string query, IPublicAPI api)
351351

352352
return result;
353353
}
354-
public string HideLnkPath()
355-
{
356-
bool lnkSetting = Main._settings.EnableHideLnkPath;
357-
if (lnkSetting)
358-
{
359-
return "";
360-
}
361-
else
362-
{
363-
return Package.Location;
364-
}
365-
}
366354

367355
public List<Result> ContextMenus(IPublicAPI api)
368356
{

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public Result Result(string query, IPublicAPI api)
9797
var result = new Result
9898
{
9999
Title = title,
100-
SubTitle = HideLnkPath(),
100+
SubTitle = Main._settings.EnableHideLnkPath ? string.Empty : LnkResolvedPath ?? FullPath,
101101
IcoPath = IcoPath,
102102
Score = matchResult.Score,
103103
TitleHighlightData = matchResult.MatchData,
@@ -545,17 +545,5 @@ public bool Equals([AllowNull] Win32 other)
545545

546546
return UniqueIdentifier == other.UniqueIdentifier;
547547
}
548-
549-
public string HideLnkPath()
550-
{
551-
bool lnkSetting = Main._settings.EnableHideLnkPath;
552-
if (lnkSetting) {
553-
return "";
554-
}
555-
else
556-
{
557-
return LnkResolvedPath ?? FullPath;
558-
}
559-
}
560548
}
561549
}

0 commit comments

Comments
 (0)