mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #1076 from Flow-Launcher/fix_path_search_with_index
Fix the use of index in path search
This commit is contained in:
commit
377c7d792e
6 changed files with 44 additions and 13 deletions
|
|
@ -15,6 +15,7 @@
|
|||
<system:String x:Key="plugin_explorer_windowsSearchServiceFix">To fix this, start the Windows Search service. Select here to remove this warning</system:String>
|
||||
<system:String x:Key="plugin_explorer_alternative">The warning message has been switched off. As an alternative for searching files and folders, would you like to install Everything plugin?{0}{0}Select 'Yes' to install Everything plugin, or 'No' to return</system:String>
|
||||
<system:String x:Key="plugin_explorer_alternative_title">Explorer Alternative</system:String>
|
||||
<system:String x:Key="plugin_explorer_directoryinfosearch_error">Error occurred during search: {0}</system:String>
|
||||
|
||||
<!--Controls-->
|
||||
<system:String x:Key="plugin_explorer_delete">Delete</system:String>
|
||||
|
|
@ -23,6 +24,8 @@
|
|||
<system:String x:Key="plugin_explorer_manageactionkeywords_header">Customise Action Keywords</system:String>
|
||||
<system:String x:Key="plugin_explorer_quickaccesslinks_header">Quick Access Links</system:String>
|
||||
<system:String x:Key="plugin_explorer_indexsearchexcludedpaths_header">Index Search Excluded Paths</system:String>
|
||||
<system:String x:Key="plugin_explorer_usewindowsindexfordirectorysearch">Use Index Search For Path Search</system:String>
|
||||
<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>
|
||||
<system:String x:Key="plugin_explorer_manageindexoptions">Indexing Options</system:String>
|
||||
<system:String x:Key="plugin_explorer_actionkeywordview_search">Search:</system:String>
|
||||
<system:String x:Key="plugin_explorer_actionkeywordview_pathsearch">Path Search:</system:String>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Flow.Launcher.Infrastructure.Logger;
|
||||
using Flow.Launcher.Infrastructure.Logger;
|
||||
using Flow.Launcher.Plugin.SharedCommands;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
|
@ -58,8 +58,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo
|
|||
{
|
||||
var directoryInfo = new System.IO.DirectoryInfo(path);
|
||||
|
||||
foreach (var fileSystemInfo in directoryInfo.EnumerateFileSystemInfos(searchCriteria, enumerationOption)
|
||||
)
|
||||
foreach (var fileSystemInfo in directoryInfo.EnumerateFileSystemInfos(searchCriteria, enumerationOption))
|
||||
{
|
||||
if (fileSystemInfo is System.IO.DirectoryInfo)
|
||||
{
|
||||
|
|
@ -76,8 +75,17 @@ namespace Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo
|
|||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Log.Exception("Flow.Plugin.Explorer.", nameof(DirectoryInfoSearch), e);
|
||||
results.Add(new Result {Title = e.Message, Score = 501});
|
||||
Log.Exception(nameof(DirectoryInfoSearch), "Error occured while searching path", e);
|
||||
|
||||
results.Add(
|
||||
new Result
|
||||
{
|
||||
Title = string.Format(SearchManager.Context.API.GetTranslation(
|
||||
"plugin_explorer_directoryinfosearch_error"),
|
||||
e.Message),
|
||||
Score = 501,
|
||||
IcoPath = Constants.ExplorerIconImagePath
|
||||
});
|
||||
|
||||
return results;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<AccessLink> QuickFolderAccessLinks { get; set; } = new List<AccessLink>();
|
||||
|
||||
public bool UseWindowsIndexForDirectorySearch { get; set; } = true;
|
||||
public bool UseWindowsIndexForDirectorySearch { get; set; } = false;
|
||||
|
||||
public List<AccessLink> IndexSearchExcludedSubdirectoryPaths { get; set; } = new List<AccessLink>();
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
@ -92,12 +91,20 @@
|
|||
Collapsed="expExcludedPaths_Collapsed"
|
||||
Expanded="expExcludedPaths_Click"
|
||||
Header="{DynamicResource plugin_explorer_indexsearchexcludedpaths_header}">
|
||||
<ListView
|
||||
x:Name="lbxExcludedPaths"
|
||||
AllowDrop="True"
|
||||
DragEnter="lbxAccessLinks_DragEnter"
|
||||
Drop="lbxAccessLinks_Drop"
|
||||
ItemTemplate="{StaticResource ListViewTemplateExcludedPaths}" />
|
||||
<StackPanel>
|
||||
<CheckBox
|
||||
Name="UseWindowsIndexForDirectorySearch"
|
||||
Margin="12,10,0,0"
|
||||
Content="{DynamicResource plugin_explorer_usewindowsindexfordirectorysearch}"
|
||||
IsChecked="{Binding UseWindowsIndexForDirectorySearch}"
|
||||
ToolTip="{DynamicResource plugin_explorer_usewindowsindexfordirectorysearch_tooltip}" />
|
||||
<ListView
|
||||
x:Name="lbxExcludedPaths"
|
||||
AllowDrop="True"
|
||||
DragEnter="lbxAccessLinks_DragEnter"
|
||||
Drop="lbxAccessLinks_Drop"
|
||||
ItemTemplate="{StaticResource ListViewTemplateExcludedPaths}" />
|
||||
</StackPanel>
|
||||
</Expander>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue