From 06877ca06b8a68d00d3709075751d0d31a165b52 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Wed, 3 Jun 2020 20:15:21 +1000 Subject: [PATCH] change to exclude sub-directories too from index search --- Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs | 4 ++-- Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 4 ++-- Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index 6aba9fcb5..38bf63f89 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -192,8 +192,8 @@ namespace Flow.Launcher.Plugin.Explorer SubTitle = "Path: " + record.FullPath, Action = _ => { - if(!Main.Settings.IndexSearchExcludedDirectoryPaths.Any(x => x == record.FullPath)) - Main.Settings.IndexSearchExcludedDirectoryPaths.Add(record.FullPath); + if(!Main.Settings.IndexSearchExcludedSubdirectoryPaths.Any(x => x == record.FullPath)) + Main.Settings.IndexSearchExcludedSubdirectoryPaths.Add(record.FullPath); return false; }, diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index ad6cdd9dc..65a2f4ac9 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -112,8 +112,8 @@ namespace Flow.Launcher.Plugin.Explorer.Search if (!_settings.UseWindowsIndexForDirectorySearch) return false; - if (_settings.IndexSearchExcludedDirectoryPaths - .Any(x => x == FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath))) + if (_settings.IndexSearchExcludedSubdirectoryPaths + .Any(x => FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath).StartsWith(x))) return false; return _indexSearch.PathIsIndexed(locationPath); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index ffa7fadd1..6b442384d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -17,6 +17,6 @@ namespace Flow.Launcher.Plugin.Explorer public bool UseWindowsIndexForDirectorySearch { get; set; } = true; [JsonProperty] - public List IndexSearchExcludedDirectoryPaths { get; set; } = new List(); + public List IndexSearchExcludedSubdirectoryPaths { get; set; } = new List(); } }