mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Optimized search
Removed redundant check.
This commit is contained in:
parent
b576ee300b
commit
10302f4bc9
1 changed files with 32 additions and 36 deletions
|
|
@ -65,51 +65,47 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel
|
|||
|
||||
foreach (var item in controlPanelItems)
|
||||
{
|
||||
if (item.LocalizedString.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0 || item.InfoTip.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
if (item.LocalizedString.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
{
|
||||
|
||||
if (item.LocalizedString.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0) //Items with Query in title have higher score.
|
||||
results.Insert(0, new Result()
|
||||
{
|
||||
results.Insert(0, new Result()
|
||||
Title = item.LocalizedString,
|
||||
SubTitle = item.InfoTip,
|
||||
IcoPath = "Images\\ControlPanelIcons\\" + item.ApplicationName + fileType,
|
||||
Action = e =>
|
||||
{
|
||||
Title = item.LocalizedString,
|
||||
SubTitle = item.InfoTip,
|
||||
IcoPath = "Images\\ControlPanelIcons\\" + item.ApplicationName + fileType,
|
||||
Action = e =>
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
Process.Start(item.ExecutablePath);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Silently Fail for now..
|
||||
}
|
||||
return true;
|
||||
Process.Start(item.ExecutablePath);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
catch (Exception)
|
||||
{
|
||||
//Silently Fail for now..
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (item.InfoTip.IndexOf(myQuery, StringComparison.OrdinalIgnoreCase) >= 0)
|
||||
{
|
||||
results.Add(new Result()
|
||||
{
|
||||
results.Add(new Result()
|
||||
Title = item.LocalizedString,
|
||||
SubTitle = item.InfoTip,
|
||||
IcoPath = "Images\\ControlPanelIcons\\" + item.ApplicationName + fileType,
|
||||
Action = e =>
|
||||
{
|
||||
Title = item.LocalizedString,
|
||||
SubTitle = item.InfoTip,
|
||||
IcoPath = "Images\\ControlPanelIcons\\" + item.ApplicationName + fileType,
|
||||
Action = e =>
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
Process.Start(item.ExecutablePath);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Silently Fail for now..
|
||||
}
|
||||
return true;
|
||||
Process.Start(item.ExecutablePath);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//Silently Fail for now..
|
||||
}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 2 && i < results.Count; i++)
|
||||
|
|
|
|||
Loading…
Reference in a new issue