Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -58,8 +58,7 @@ private static List<Result> DirectorySearch(EnumerationOptions enumerationOption
{
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)
{
Expand All @@ -76,8 +75,17 @@ private static List<Result> DirectorySearch(EnumerationOptions enumerationOption
}
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;
}
Expand Down
2 changes: 1 addition & 1 deletion Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Settings
// 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>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,16 @@ internal bool IsActionKeywordAlreadyAssigned(string newActionKeyword)
}

internal bool IsNewActionKeywordGlobal(string newActionKeyword) => newActionKeyword == Query.GlobalPluginWildcardSign;

public bool UseWindowsIndexForDirectorySearch {
get
{
return Settings.UseWindowsIndexForDirectorySearch;
}
set
{
Settings.UseWindowsIndexForDirectorySearch = value;
}
}
}
}
21 changes: 14 additions & 7 deletions Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -91,12 +90,20 @@
Margin="0,10,0,0"
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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public ExplorerSettings(SettingsViewModel viewModel)

this.viewModel = viewModel;

DataContext = viewModel;

lbxAccessLinks.ItemsSource = this.viewModel.Settings.QuickAccessLinks;

lbxExcludedPaths.ItemsSource = this.viewModel.Settings.IndexSearchExcludedSubdirectoryPaths;
Expand Down