mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
#129 exclude system plugins results when searching websearch.
This commit is contained in:
parent
9805ab8761
commit
0a45a6fea9
2 changed files with 15 additions and 5 deletions
|
|
@ -51,7 +51,7 @@ namespace Wox.Plugin.SystemPlugins.Program
|
|||
|
||||
protected override List<Result> QueryInternal(Query query)
|
||||
{
|
||||
if (query.RawQuery.Length <= 1) return new List<Result>();
|
||||
if (query.RawQuery.Trim().Length <= 1) return new List<Result>();
|
||||
|
||||
var fuzzyMather = FuzzyMatcher.Create(query.RawQuery);
|
||||
List<Program> returnList = installedList.Where(o => MatchProgram(o, fuzzyMather)).ToList();
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using System.Text;
|
|||
using System.Threading;
|
||||
using Wox.Infrastructure.Storage.UserSettings;
|
||||
using Wox.Plugin;
|
||||
using Wox.Plugin.SystemPlugins;
|
||||
using Wox.PluginLoader;
|
||||
|
||||
namespace Wox.Commands
|
||||
|
|
@ -13,16 +14,25 @@ namespace Wox.Commands
|
|||
{
|
||||
public override void Dispatch(Query query)
|
||||
{
|
||||
foreach (PluginPair pair in Plugins.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.System))
|
||||
var allSytemPlugins = Plugins.AllPlugins.Where(o => o.Metadata.PluginType == PluginType.System);
|
||||
if (UserSettingStorage.Instance.WebSearches.Exists(o => o.ActionWord == query.ActionName && o.Enabled))
|
||||
{
|
||||
//websearch mode
|
||||
allSytemPlugins = new List<PluginPair>()
|
||||
{
|
||||
allSytemPlugins.First(o => ((ISystemPlugin)o.Plugin).ID == "565B73353DBF4806919830B9202EE3BF")
|
||||
};
|
||||
}
|
||||
|
||||
foreach (PluginPair pair in allSytemPlugins)
|
||||
{
|
||||
PluginPair pair1 = pair;
|
||||
|
||||
ThreadPool.QueueUserWorkItem(state =>
|
||||
{
|
||||
List<Result> results = pair1.Plugin.Query(query);
|
||||
results.ForEach(o=> { o.AutoAjustScore = true; });
|
||||
results.ForEach(o => { o.AutoAjustScore = true; });
|
||||
|
||||
App.Window.PushResults(query,pair1.Metadata,results);
|
||||
App.Window.PushResults(query, pair1.Metadata, results);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue