From cc283fd5dc69277d968c52f8537d050c1f49fce1 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Sun, 13 Mar 2022 14:27:46 +1100 Subject: [PATCH] allow option to enable/disable the use of index in path search --- .../Languages/en.xaml | 2 ++ .../Flow.Launcher.Plugin.Explorer/Settings.cs | 2 +- .../ViewModels/SettingsViewModel.cs | 11 ++++++++++ .../Views/ExplorerSettings.xaml | 21 ++++++++++++------- .../Views/ExplorerSettings.xaml.cs | 2 ++ 5 files changed, 30 insertions(+), 8 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index e23bd77bd..053cbff2c 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -23,6 +23,8 @@ Customise Action Keywords Quick Access Links Index Search Excluded Paths + Use Index Search For Path Search + Turning this on will return indexed directories/files faster, but if a directory/file is not indexed it will not show up. If a directory/file has been added to Index Search Excluded Path then it will still show up even if this option is on Indexing Options Search: Path Search: diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index 351091dfe..90b85d187 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -14,7 +14,7 @@ namespace Flow.Launcher.Plugin.Explorer // as at v1.7.0 this is to maintain backwards compatibility, need to be removed afterwards. public List QuickFolderAccessLinks { get; set; } = new List(); - public bool UseWindowsIndexForDirectorySearch { get; set; } = true; + public bool UseWindowsIndexForDirectorySearch { get; set; } = false; public List IndexSearchExcludedSubdirectoryPaths { get; set; } = new List(); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs index 77ec5457b..9167691b4 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs @@ -52,5 +52,16 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels } internal bool IsNewActionKeywordGlobal(string newActionKeyword) => newActionKeyword == Query.GlobalPluginWildcardSign; + + public bool UseWindowsIndexForDirectorySearch { + get + { + return Settings.UseWindowsIndexForDirectorySearch; + } + set + { + Settings.UseWindowsIndexForDirectorySearch = value; + } + } } } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml index bbaacc18c..8f82c0a16 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml @@ -4,7 +4,6 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:viewModels="clr-namespace:Flow.Launcher.Plugin.Explorer.ViewModels" xmlns:views="clr-namespace:Flow.Launcher.Plugin.Explorer.Views" d:DesignHeight="450" d:DesignWidth="800" @@ -91,12 +90,20 @@ Margin="0,10,0,0" Expanded="expExcludedPaths_Click" Header="{DynamicResource plugin_explorer_indexsearchexcludedpaths_header}"> - + + + + diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs index 6f0bc49ee..37b6a95d8 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs @@ -29,6 +29,8 @@ namespace Flow.Launcher.Plugin.Explorer.Views this.viewModel = viewModel; + DataContext = viewModel; + lbxAccessLinks.ItemsSource = this.viewModel.Settings.QuickAccessLinks; lbxExcludedPaths.ItemsSource = this.viewModel.Settings.IndexSearchExcludedSubdirectoryPaths;