mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Refactoring instant query
This commit is contained in:
@@ -200,11 +200,7 @@ namespace Wox.Plugin.CMD
|
||||
return context.API.GetTranslation("wox_plugin_cmd_plugin_description");
|
||||
}
|
||||
|
||||
public bool IsInstantQuery(string query)
|
||||
{
|
||||
if (query.StartsWith(">")) return true;
|
||||
return false;
|
||||
}
|
||||
public bool IsInstantQuery(string query) => false;
|
||||
|
||||
public bool IsExclusiveQuery(Query query)
|
||||
{
|
||||
|
||||
@@ -120,19 +120,16 @@ namespace Wox.Plugin.WebSearch
|
||||
return context.API.GetTranslation("wox_plugin_websearch_plugin_description");
|
||||
}
|
||||
|
||||
public bool IsInstantQuery(string query)
|
||||
public bool IsInstantQuery(string query) => false;
|
||||
|
||||
public bool IsExclusiveQuery(Query query)
|
||||
{
|
||||
var strings = query.Split(' ');
|
||||
var strings = query.RawQuery.Split(' ');
|
||||
if (strings.Length > 1)
|
||||
{
|
||||
return WebSearchStorage.Instance.WebSearches.Exists(o => o.ActionWord == strings[0] && o.Enabled);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsExclusiveQuery(Query query)
|
||||
{
|
||||
return IsInstantQuery(query.RawQuery);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user