|
1 |
| -using Flow.Launcher.Core.Resource; |
2 |
| -using Flow.Launcher.Infrastructure; |
3 |
| -using Flow.Launcher.Plugin.SharedCommands; |
4 |
| -using System; |
| 1 | +using System; |
5 | 2 | using System.IO;
|
6 | 3 | using System.Linq;
|
7 | 4 | using System.Threading.Tasks;
|
8 |
| -using Flow.Launcher.Plugin.Explorer.Search.Everything; |
9 |
| -using System.Windows.Input; |
10 |
| -using Path = System.IO.Path; |
11 | 5 | using System.Windows.Controls;
|
| 6 | +using System.Windows.Input; |
| 7 | +using Flow.Launcher.Plugin.Explorer.Search.Everything; |
12 | 8 | using Flow.Launcher.Plugin.Explorer.Views;
|
| 9 | +using Flow.Launcher.Plugin.SharedCommands; |
13 | 10 | using Peter;
|
| 11 | +using Path = System.IO.Path; |
14 | 12 |
|
15 | 13 | namespace Flow.Launcher.Plugin.Explorer.Search
|
16 | 14 | {
|
@@ -66,7 +64,7 @@ public static Result CreateResult(Query query, SearchResult result)
|
66 | 64 | CreateFolderResult(Path.GetFileName(result.FullPath), result.FullPath, result.FullPath, query, result.Score, result.WindowsIndexed),
|
67 | 65 | ResultType.File =>
|
68 | 66 | CreateFileResult(result.FullPath, query, result.Score, result.WindowsIndexed),
|
69 |
| - _ => throw new ArgumentOutOfRangeException() |
| 67 | + _ => throw new ArgumentOutOfRangeException(null) |
70 | 68 | };
|
71 | 69 | }
|
72 | 70 |
|
@@ -99,7 +97,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
|
99 | 97 | IcoPath = path,
|
100 | 98 | SubTitle = subtitle,
|
101 | 99 | AutoCompleteText = GetAutoCompleteText(title, query, path, ResultType.Folder),
|
102 |
| - TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData, |
| 100 | + TitleHighlightData = Context.API.FuzzySearch(query.Search, title).MatchData, |
103 | 101 | CopyText = path,
|
104 | 102 | Preview = new Result.PreviewInfo
|
105 | 103 | {
|
@@ -164,7 +162,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
|
164 | 162 | return false;
|
165 | 163 | },
|
166 | 164 | Score = score,
|
167 |
| - TitleToolTip = InternationalizationManager.Instance.GetTranslation("plugin_explorer_plugin_ToolTipOpenDirectory"), |
| 165 | + TitleToolTip = Main.Context.API.GetTranslation("plugin_explorer_plugin_ToolTipOpenDirectory"), |
168 | 166 | SubTitleToolTip = path,
|
169 | 167 | ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path, WindowsIndexed = windowsIndexed }
|
170 | 168 | };
|
@@ -286,7 +284,7 @@ internal static Result CreateFileResult(string filePath, Query query, int score
|
286 | 284 | FilePath = filePath,
|
287 | 285 | },
|
288 | 286 | AutoCompleteText = GetAutoCompleteText(title, query, filePath, ResultType.File),
|
289 |
| - TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData, |
| 287 | + TitleHighlightData = Context.API.FuzzySearch(query.Search, title).MatchData, |
290 | 288 | Score = score,
|
291 | 289 | CopyText = filePath,
|
292 | 290 | PreviewPanel = new Lazy<UserControl>(() => new PreviewPanel(Settings, filePath)),
|
@@ -319,7 +317,7 @@ internal static Result CreateFileResult(string filePath, Query query, int score
|
319 | 317 |
|
320 | 318 | return true;
|
321 | 319 | },
|
322 |
| - TitleToolTip = InternationalizationManager.Instance.GetTranslation("plugin_explorer_plugin_ToolTipOpenContainingFolder"), |
| 320 | + TitleToolTip = Main.Context.API.GetTranslation("plugin_explorer_plugin_ToolTipOpenContainingFolder"), |
323 | 321 | SubTitleToolTip = filePath,
|
324 | 322 | ContextData = new SearchResult { Type = ResultType.File, FullPath = filePath, WindowsIndexed = windowsIndexed }
|
325 | 323 | };
|
|
0 commit comments