Skip to content

Commit cc283fd

Browse files
committed
allow option to enable/disable the use of index in path search
1 parent 749e7ff commit cc283fd

File tree

5 files changed

+30
-8
lines changed

5 files changed

+30
-8
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
<system:String x:Key="plugin_explorer_manageactionkeywords_header">Customise Action Keywords</system:String>
2424
<system:String x:Key="plugin_explorer_quickaccesslinks_header">Quick Access Links</system:String>
2525
<system:String x:Key="plugin_explorer_indexsearchexcludedpaths_header">Index Search Excluded Paths</system:String>
26+
<system:String x:Key="plugin_explorer_usewindowsindexfordirectorysearch">Use Index Search For Path Search</system:String>
27+
<system:String x:Key="plugin_explorer_usewindowsindexfordirectorysearch_tooltip">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</system:String>
2628
<system:String x:Key="plugin_explorer_manageindexoptions">Indexing Options</system:String>
2729
<system:String x:Key="plugin_explorer_actionkeywordview_search">Search:</system:String>
2830
<system:String x:Key="plugin_explorer_actionkeywordview_pathsearch">Path Search:</system:String>

Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class Settings
1414
// as at v1.7.0 this is to maintain backwards compatibility, need to be removed afterwards.
1515
public List<AccessLink> QuickFolderAccessLinks { get; set; } = new List<AccessLink>();
1616

17-
public bool UseWindowsIndexForDirectorySearch { get; set; } = true;
17+
public bool UseWindowsIndexForDirectorySearch { get; set; } = false;
1818

1919
public List<AccessLink> IndexSearchExcludedSubdirectoryPaths { get; set; } = new List<AccessLink>();
2020

Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,16 @@ internal bool IsActionKeywordAlreadyAssigned(string newActionKeyword)
5252
}
5353

5454
internal bool IsNewActionKeywordGlobal(string newActionKeyword) => newActionKeyword == Query.GlobalPluginWildcardSign;
55+
56+
public bool UseWindowsIndexForDirectorySearch {
57+
get
58+
{
59+
return Settings.UseWindowsIndexForDirectorySearch;
60+
}
61+
set
62+
{
63+
Settings.UseWindowsIndexForDirectorySearch = value;
64+
}
65+
}
5566
}
5667
}

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7-
xmlns:viewModels="clr-namespace:Flow.Launcher.Plugin.Explorer.ViewModels"
87
xmlns:views="clr-namespace:Flow.Launcher.Plugin.Explorer.Views"
98
d:DesignHeight="450"
109
d:DesignWidth="800"
@@ -91,12 +90,20 @@
9190
Margin="0,10,0,0"
9291
Expanded="expExcludedPaths_Click"
9392
Header="{DynamicResource plugin_explorer_indexsearchexcludedpaths_header}">
94-
<ListView
95-
x:Name="lbxExcludedPaths"
96-
AllowDrop="True"
97-
DragEnter="lbxAccessLinks_DragEnter"
98-
Drop="lbxAccessLinks_Drop"
99-
ItemTemplate="{StaticResource ListViewTemplateExcludedPaths}" />
93+
<StackPanel>
94+
<CheckBox
95+
Name="UseWindowsIndexForDirectorySearch"
96+
Margin="12,10,0,0"
97+
Content="{DynamicResource plugin_explorer_usewindowsindexfordirectorysearch}"
98+
IsChecked="{Binding UseWindowsIndexForDirectorySearch}"
99+
ToolTip="{DynamicResource plugin_explorer_usewindowsindexfordirectorysearch_tooltip}" />
100+
<ListView
101+
x:Name="lbxExcludedPaths"
102+
AllowDrop="True"
103+
DragEnter="lbxAccessLinks_DragEnter"
104+
Drop="lbxAccessLinks_Drop"
105+
ItemTemplate="{StaticResource ListViewTemplateExcludedPaths}" />
106+
</StackPanel>
100107
</Expander>
101108
</StackPanel>
102109
</ScrollViewer>

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ public ExplorerSettings(SettingsViewModel viewModel)
2929

3030
this.viewModel = viewModel;
3131

32+
DataContext = viewModel;
33+
3234
lbxAccessLinks.ItemsSource = this.viewModel.Settings.QuickAccessLinks;
3335

3436
lbxExcludedPaths.ItemsSource = this.viewModel.Settings.IndexSearchExcludedSubdirectoryPaths;

0 commit comments

Comments
 (0)