mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
change query translation to Program.Main instead of using Alphabet.Tranlate to avoid cache.
This commit is contained in:
parent
d17621cd2e
commit
c4b81a9429
2 changed files with 5 additions and 3 deletions
|
|
@ -50,7 +50,6 @@ namespace Flow.Launcher.Infrastructure
|
|||
|
||||
if (_alphabet != null)
|
||||
{
|
||||
query = _alphabet.Translate(query);
|
||||
stringToCompare = _alphabet.Translate(stringToCompare);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ using Flow.Launcher.Infrastructure.Logger;
|
|||
using Flow.Launcher.Infrastructure.Storage;
|
||||
using Flow.Launcher.Plugin.Program.Programs;
|
||||
using Flow.Launcher.Plugin.Program.Views;
|
||||
using ToolGood.Words.Pinyin;
|
||||
using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch;
|
||||
|
||||
namespace Flow.Launcher.Plugin.Program
|
||||
|
|
@ -77,13 +78,15 @@ namespace Flow.Launcher.Plugin.Program
|
|||
uwps = _uwps;
|
||||
}
|
||||
|
||||
var searchText = WordsHelper.HasChinese(query.Search) ? WordsHelper.GetPinyin(query.Search) : query.Search;
|
||||
|
||||
var results1 = win32.AsParallel()
|
||||
.Where(p => p.Enabled)
|
||||
.Select(p => p.Result(query.Search, _context.API));
|
||||
.Select(p => p.Result(searchText, _context.API));
|
||||
|
||||
var results2 = uwps.AsParallel()
|
||||
.Where(p => p.Enabled)
|
||||
.Select(p => p.Result(query.Search, _context.API));
|
||||
.Select(p => p.Result(searchText, _context.API));
|
||||
|
||||
var result = results1.Concat(results2).Where(r => r != null && r.Score > 0).ToList();
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Reference in a new issue