From bd15aa7ef912f7ded36d4fecd85e25d775e1145b Mon Sep 17 00:00:00 2001 From: Jeremy Date: Tue, 27 Jul 2021 18:55:52 +1000 Subject: [PATCH] pass query helper object --- .../Search/SearchManager.cs | 9 +++++---- .../Search/WindowsIndex/IndexSearch.cs | 15 ++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index d86007e74..9995f45d3 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -143,7 +143,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search return await IndexSearch.WindowsIndexSearchAsync( querySearchString, - queryConstructor.CreateQueryHelper, + queryConstructor.CreateQueryHelper(), queryConstructor.QueryForFileContentSearch, Settings.IndexSearchExcludedSubdirectoryPaths, query, @@ -181,7 +181,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search return await IndexSearch.WindowsIndexSearchAsync( querySearchString, - queryConstructor.CreateQueryHelper, + queryConstructor.CreateQueryHelper(), queryConstructor.QueryForAllFilesAndFolders, Settings.IndexSearchExcludedSubdirectoryPaths, query, @@ -193,8 +193,9 @@ namespace Flow.Launcher.Plugin.Explorer.Search { var queryConstructor = new QueryConstructor(Settings); - return await IndexSearch.WindowsIndexSearchAsync(path, - queryConstructor.CreateQueryHelper, + return await IndexSearch.WindowsIndexSearchAsync( + path, + queryConstructor.CreateQueryHelper(), queryConstructor.QueryForTopLevelDirectorySearch, Settings.IndexSearchExcludedSubdirectoryPaths, query, diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs index d42989457..010a19b58 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs @@ -86,12 +86,13 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex return results; } - internal async static Task> WindowsIndexSearchAsync(string searchString, - Func queryHelper, - Func constructQuery, - List exclusionList, - Query query, - CancellationToken token) + internal async static Task> WindowsIndexSearchAsync( + string searchString, + CSearchQueryHelper queryHelper, + Func constructQuery, + List exclusionList, + Query query, + CancellationToken token) { var regexMatch = Regex.Match(searchString, reservedStringPattern); @@ -103,7 +104,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex var constructedQuery = constructQuery(searchString); return RemoveResultsInExclusionList( - await ExecuteWindowsIndexSearchAsync(constructedQuery, queryHelper().ConnectionString, query, token).ConfigureAwait(false), + await ExecuteWindowsIndexSearchAsync(constructedQuery, queryHelper.ConnectionString, query, token).ConfigureAwait(false), exclusionList, token); }