simplify if condition for hide app path

This commit is contained in:
Jeremy 2021-11-29 20:36:34 +11:00
parent dbf3f1e159
commit 51481d7766
3 changed files with 3 additions and 27 deletions

View file

@ -17,7 +17,7 @@
<system:String x:Key="flowlauncher_plugin_program_index_start_tooltip">When enabled, Flow will load programs from the start menu</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_registry">Index Registry</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_registry_tooltip">When enabled, Flow will load programs from the registry</system:String>
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath">Hide Apps path</system:String>
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath">Hide app path</system:String>
<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>
<system:String x:Key="flowlauncher_plugin_program_enable_description">Search in Program Description</system:String>
<system:String x:Key="flowlauncher_plugin_program_enable_description_tooltip">Disabling this will also stop Flow from searching via the program desciption</system:String>

View file

@ -314,7 +314,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
var result = new Result
{
Title = title,
SubTitle = HideLnkPath(),
SubTitle = Main._settings.EnableHideLnkPath ? string.Empty : Package.Location,
Icon = Logo,
Score = matchResult.Score,
TitleHighlightData = matchResult.MatchData,
@ -351,18 +351,6 @@ namespace Flow.Launcher.Plugin.Program.Programs
return result;
}
public string HideLnkPath()
{
bool lnkSetting = Main._settings.EnableHideLnkPath;
if (lnkSetting)
{
return "";
}
else
{
return Package.Location;
}
}
public List<Result> ContextMenus(IPublicAPI api)
{

View file

@ -97,7 +97,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
var result = new Result
{
Title = title,
SubTitle = HideLnkPath(),
SubTitle = Main._settings.EnableHideLnkPath ? string.Empty : LnkResolvedPath ?? FullPath,
IcoPath = IcoPath,
Score = matchResult.Score,
TitleHighlightData = matchResult.MatchData,
@ -545,17 +545,5 @@ namespace Flow.Launcher.Plugin.Program.Programs
return UniqueIdentifier == other.UniqueIdentifier;
}
public string HideLnkPath()
{
bool lnkSetting = Main._settings.EnableHideLnkPath;
if (lnkSetting) {
return "";
}
else
{
return LnkResolvedPath ?? FullPath;
}
}
}
}