Skip to content

Commit bd15aa7

Browse files
committed
pass query helper object
1 parent f588f2a commit bd15aa7

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private async Task<List<Result>> WindowsIndexFileContentSearchAsync(Query query,
143143

144144
return await IndexSearch.WindowsIndexSearchAsync(
145145
querySearchString,
146-
queryConstructor.CreateQueryHelper,
146+
queryConstructor.CreateQueryHelper(),
147147
queryConstructor.QueryForFileContentSearch,
148148
Settings.IndexSearchExcludedSubdirectoryPaths,
149149
query,
@@ -181,7 +181,7 @@ private async Task<List<Result>> WindowsIndexFilesAndFoldersSearchAsync(Query qu
181181

182182
return await IndexSearch.WindowsIndexSearchAsync(
183183
querySearchString,
184-
queryConstructor.CreateQueryHelper,
184+
queryConstructor.CreateQueryHelper(),
185185
queryConstructor.QueryForAllFilesAndFolders,
186186
Settings.IndexSearchExcludedSubdirectoryPaths,
187187
query,
@@ -193,8 +193,9 @@ private async Task<List<Result>> WindowsIndexTopLevelFolderSearchAsync(Query que
193193
{
194194
var queryConstructor = new QueryConstructor(Settings);
195195

196-
return await IndexSearch.WindowsIndexSearchAsync(path,
197-
queryConstructor.CreateQueryHelper,
196+
return await IndexSearch.WindowsIndexSearchAsync(
197+
path,
198+
queryConstructor.CreateQueryHelper(),
198199
queryConstructor.QueryForTopLevelDirectorySearch,
199200
Settings.IndexSearchExcludedSubdirectoryPaths,
200201
query,

Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,13 @@ internal static async Task<List<Result>> ExecuteWindowsIndexSearchAsync(string i
8686
return results;
8787
}
8888

89-
internal async static Task<List<Result>> WindowsIndexSearchAsync(string searchString,
90-
Func<CSearchQueryHelper> queryHelper,
91-
Func<string, string> constructQuery,
92-
List<AccessLink> exclusionList,
93-
Query query,
94-
CancellationToken token)
89+
internal async static Task<List<Result>> WindowsIndexSearchAsync(
90+
string searchString,
91+
CSearchQueryHelper queryHelper,
92+
Func<string, string> constructQuery,
93+
List<AccessLink> exclusionList,
94+
Query query,
95+
CancellationToken token)
9596
{
9697
var regexMatch = Regex.Match(searchString, reservedStringPattern);
9798

@@ -103,7 +104,7 @@ internal async static Task<List<Result>> WindowsIndexSearchAsync(string searchSt
103104
var constructedQuery = constructQuery(searchString);
104105

105106
return RemoveResultsInExclusionList(
106-
await ExecuteWindowsIndexSearchAsync(constructedQuery, queryHelper().ConnectionString, query, token).ConfigureAwait(false),
107+
await ExecuteWindowsIndexSearchAsync(constructedQuery, queryHelper.ConnectionString, query, token).ConfigureAwait(false),
107108
exclusionList,
108109
token);
109110
}

0 commit comments

Comments
 (0)