mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
fix exclusion of Windows Index file or folder search
This commit is contained in:
parent
8577dbe3bf
commit
43f1cae350
2 changed files with 25 additions and 2 deletions
|
|
@ -67,7 +67,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
{
|
||||
results.UnionWith(await WindowsIndexFilesAndFoldersSearchAsync(query, querySearch, token).ConfigureAwait(false));
|
||||
|
||||
return results.ToList();
|
||||
return FilterOutResultsFromWindowsIndexExclusionList(results).ToList();
|
||||
}
|
||||
|
||||
var locationPath = querySearch;
|
||||
|
|
@ -159,6 +159,29 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
token).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
private HashSet<Result> FilterOutResultsFromWindowsIndexExclusionList(HashSet<Result> results)
|
||||
{
|
||||
var indexExclusionList = settings.IndexSearchExcludedSubdirectoryPaths;
|
||||
|
||||
var indexExclusionListCount = indexExclusionList.Count;
|
||||
|
||||
if (indexExclusionListCount == 0)
|
||||
return results;
|
||||
|
||||
var filteredResults = new HashSet<Result>(PathEqualityComparator.Instance);
|
||||
|
||||
foreach (var r in results)
|
||||
{
|
||||
for (var i = 0; i < indexExclusionListCount; i++)
|
||||
{
|
||||
if (!r.SubTitle.StartsWith(indexExclusionList[0].Path, StringComparison.OrdinalIgnoreCase))
|
||||
filteredResults.Add(r);
|
||||
}
|
||||
}
|
||||
|
||||
return filteredResults;
|
||||
}
|
||||
|
||||
private bool UseWindowsIndexForDirectorySearch(string locationPath)
|
||||
{
|
||||
var pathToDirectory = FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
"Name": "Explorer",
|
||||
"Description": "Search and manage files and folders. Explorer utilises Windows Index Search",
|
||||
"Author": "Jeremy Wu",
|
||||
"Version": "1.7.1",
|
||||
"Version": "1.7.2",
|
||||
"Language": "csharp",
|
||||
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
|
||||
"ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll",
|
||||
|
|
|
|||
Loading…
Reference in a new issue