Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
7c35c3e
Merge branch 'dev'
jjw24 Jun 28, 2020
d42d35e
Merge pull request #101 from Flow-Launcher/dev
jjw24 Jul 4, 2020
5f23f3d
Merge pull request #110 from Flow-Launcher/dev
jjw24 Jul 5, 2020
8a9c338
Merge pull request #112 from Flow-Launcher/dev
jjw24 Jul 5, 2020
a8bfe6e
Merge pull request #124 from Flow-Launcher/dev
jjw24 Aug 17, 2020
135f63a
Merge pull request #146 from Flow-Launcher/dev
jjw24 Aug 27, 2020
927bfc6
fix not triggering due to ActionKeyword is string empty when global
jjw24 Aug 25, 2020
0a32478
separate methods to better reflect responsibility
jjw24 Aug 25, 2020
744d52d
change QuickFolderAccess behaviour to continue with index search
jjw24 Aug 25, 2020
b55efad
move contents search up
jjw24 Aug 25, 2020
e977c2b
make the code more obvious when triggering full quick folder access list
jjw24 Aug 25, 2020
1cc09fa
version bump Explorer plugin
jjw24 Aug 25, 2020
d99d722
prevent user from using global action keyword for content search
jjw24 Aug 25, 2020
c649e16
move default content search action keyword string to constants
jjw24 Aug 25, 2020
4a530ea
prevent index search when only '_' in query
jjw24 Aug 25, 2020
26bf0b8
fix file extension search using '*' failing
jjw24 Aug 26, 2020
f2a5915
Add 'app_missing_img.png' icon
ArttuLai Sep 1, 2020
43c9fd0
Add rest of the icons
ArttuLai Sep 3, 2020
5cad3fb
Remove botched export 1/2
ArttuLai Sep 3, 2020
a7b5152
Remove botched export 2/2
ArttuLai Sep 3, 2020
22c2bfe
Add fixed images back
ArttuLai Sep 3, 2020
4f8d139
move app_missing_img files to its own folder
jjw24 Sep 3, 2020
17e7599
encode # symbol part of the path when creating uri
jjw24 Aug 30, 2020
31867f2
version bump Explorer plugin
jjw24 Aug 30, 2020
26145c8
use StringComparison.OrdinalIgnoreCase when calling String.Replace
jjw24 Aug 31, 2020
74d7710
move Quick Folder Access list all method up
jjw24 Sep 21, 2020
a93230b
update method name typo
jjw24 Sep 21, 2020
1f39351
version bump for Flow.Launcher.Plugin
jjw24 Sep 21, 2020
a039730
sort ProcessKiller plugin's results ascending
jjw24 Sep 23, 2020
9167f2f
version bump ProcessKiller plugin
jjw24 Sep 23, 2020
6b5c5a2
add dedicated missing img icon
jjw24 Sep 6, 2020
12f8775
version bump
jjw24 Sep 6, 2020
afcb3b1
plugin/pkiller: fix context menu results
JohnTheGr8 Oct 11, 2020
74fa02d
plugin/pkiller: improve kill-all option
JohnTheGr8 Oct 11, 2020
3c2137f
Move old HttpWebRequest to HttpClient
taooceros Oct 13, 2020
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
Binary file added Doc/Default Icons/app_missing_img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/Default Icons/app_missing_img_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions Doc/Default Icons/app_missing_img_01.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/Default Icons/app_missing_img_02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions Doc/Default Icons/app_missing_img_02.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/Default Icons/app_missing_img_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions Doc/Default Icons/app_missing_img_03.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/Default Icons/app_missing_img_buttons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions Doc/Default Icons/app_missing_img_buttons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/Default Icons/app_missing_img_fluent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions Doc/Default Icons/app_missing_img_fluent.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/Default Icons/app_missing_img_huge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions Doc/Default Icons/app_missing_img_huge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/Default Icons/app_missing_img_lightblue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions Doc/Default Icons/app_missing_img_lightblue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions Doc/Default Icons/app_missing_img_lightblue_buttons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/Default Icons/app_missing_img_minimal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 40 additions & 0 deletions Doc/Default Icons/app_missing_img_minimal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions Doc/Default Icons/app_missing_img_minimal_buttons.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Doc/app_missing_img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Flow.Launcher.Core/Configuration/Portable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void RemoveUninstallerEntry()

public void MoveUserDataFolder(string fromLocation, string toLocation)
{
FilesFolders.Copy(fromLocation, toLocation);
FilesFolders.CopyAll(fromLocation, toLocation);
VerifyUserDataAfterMove(fromLocation, toLocation);
}

Expand Down
4 changes: 2 additions & 2 deletions Flow.Launcher.Core/Updater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public async Task UpdateApp(IPublicAPI api , bool silentUpdate = true)
if (DataLocation.PortableDataLocationInUse())
{
var targetDestination = updateManager.RootAppDirectory + $"\\app-{newReleaseVersion.ToString()}\\{DataLocation.PortableFolderName}";
FilesFolders.Copy(DataLocation.PortableDataPath, targetDestination);
FilesFolders.CopyAll(DataLocation.PortableDataPath, targetDestination);
if (!FilesFolders.VerifyBothFolderFilesEqual(DataLocation.PortableDataPath, targetDestination))
MessageBox.Show("Flow Launcher was not able to move your user profile data to the new update version. Please manually " +
$"move your profile data folder from {DataLocation.PortableDataPath} to {targetDestination}");
Expand Down Expand Up @@ -139,7 +139,7 @@ private async Task<UpdateManager> GitHubUpdateManager(string repository)
var latest = releases.Where(r => !r.Prerelease).OrderByDescending(r => r.PublishedAt).First();
var latestUrl = latest.HtmlUrl.Replace("/tag/", "/download/");

var client = new WebClient { Proxy = Http.WebProxy() };
var client = new WebClient { Proxy = Http.WebProxy };
var downloader = new FileDownloader(client);

var manager = new UpdateManager(latestUrl, urlDownloader: downloader);
Expand Down
6 changes: 4 additions & 2 deletions Flow.Launcher.Infrastructure/Constant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ public static class Constant
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).ProductVersion;

public static readonly int ThumbnailSize = 64;
public static readonly string DefaultIcon = Path.Combine(ProgramDirectory, "Images", "app.png");
public static readonly string ErrorIcon = Path.Combine(ProgramDirectory, "Images", "app_error.png");
private static readonly string ImagesDirectory = Path.Combine(ProgramDirectory, "Images");
public static readonly string DefaultIcon = Path.Combine(ImagesDirectory, "app.png");
public static readonly string ErrorIcon = Path.Combine(ImagesDirectory, "app_error.png");
public static readonly string MissingImgIcon = Path.Combine(ImagesDirectory, "app_missing_img.png");

public static string PythonPath;

Expand Down
78 changes: 48 additions & 30 deletions Flow.Launcher.Infrastructure/Http/Http.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,77 +6,95 @@
using JetBrains.Annotations;
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Infrastructure.UserSettings;
using System;

namespace Flow.Launcher.Infrastructure.Http
{
public static class Http
{
private const string UserAgent = @"Mozilla/5.0 (Trident/7.0; rv:11.0) like Gecko";

private static HttpClient client;
private static SocketsHttpHandler socketsHttpHandler = new SocketsHttpHandler()
{
UseProxy = true,
Proxy = WebProxy
};

static Http()
{
// need to be added so it would work on a win10 machine
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls
| SecurityProtocolType.Tls11
| SecurityProtocolType.Tls12;

client.DefaultRequestHeaders.Add("User-Agent", UserAgent);

}
private static HttpProxy proxy;
public static HttpProxy Proxy
{
private get
{
return proxy;
}
set
{
proxy = value;
UpdateProxy();
}
}

public static HttpProxy Proxy { private get; set; }
public static IWebProxy WebProxy()
public static WebProxy WebProxy { get; private set; }

/// <summary>
/// Update the Address of the Proxy to modify the client Proxy
/// </summary>
public static void UpdateProxy()
// TODO: need test with a proxy
{
if (Proxy != null && Proxy.Enabled && !string.IsNullOrEmpty(Proxy.Server))
{
if (string.IsNullOrEmpty(Proxy.UserName) || string.IsNullOrEmpty(Proxy.Password))
{
var webProxy = new WebProxy(Proxy.Server, Proxy.Port);
return webProxy;
WebProxy.Address = new Uri($"http://{Proxy.Server}:{Proxy.Port}");
WebProxy.Credentials = null;
}
else
{
var webProxy = new WebProxy(Proxy.Server, Proxy.Port)
{
Credentials = new NetworkCredential(Proxy.UserName, Proxy.Password)
};
return webProxy;
WebProxy.Address = new Uri($"http://{Proxy.Server}:{Proxy.Port}");
WebProxy.Credentials = new NetworkCredential(Proxy.UserName, Proxy.Password);
}
}
else
{
return WebRequest.GetSystemWebProxy();
WebProxy.Address = new WebProxy().Address;
WebProxy.Credentials = null;
}
}

public static void Download([NotNull] string url, [NotNull] string filePath)
{
var client = new WebClient { Proxy = WebProxy() };
var client = new WebClient { Proxy = WebProxy };
client.Headers.Add("user-agent", UserAgent);
client.DownloadFile(url, filePath);
}

public static async Task<string> Get([NotNull] string url, string encoding = "UTF-8")
{
Log.Debug($"|Http.Get|Url <{url}>");
var request = WebRequest.CreateHttp(url);
request.Method = "GET";
request.Timeout = 1000;
request.Proxy = WebProxy();
request.UserAgent = UserAgent;
var response = await request.GetResponseAsync() as HttpWebResponse;
response = response.NonNull();
var stream = response.GetResponseStream().NonNull();

using (var reader = new StreamReader(stream, Encoding.GetEncoding(encoding)))
var response = await client.GetAsync(url);
using var stream = await response.Content.ReadAsStreamAsync();
using var reader = new StreamReader(stream, Encoding.GetEncoding(encoding));
var content = await reader.ReadToEndAsync();
if (response.StatusCode == HttpStatusCode.OK)
{
var content = await reader.ReadToEndAsync();
if (response.StatusCode == HttpStatusCode.OK)
{
return content;
}
else
{
throw new HttpRequestException($"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
}
return content;
}
else
{
throw new HttpRequestException($"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions Flow.Launcher.Infrastructure/Image/ImageLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static void Initialize()

_imageCache.Usage = LoadStorageToConcurrentDictionary();

foreach (var icon in new[] { Constant.DefaultIcon, Constant.ErrorIcon })
foreach (var icon in new[] { Constant.DefaultIcon, Constant.MissingImgIcon })
{
ImageSource img = new BitmapImage(new Uri(icon));
img.Freeze();
Expand Down Expand Up @@ -106,7 +106,7 @@ private static ImageResult LoadInternal(string path, bool loadFullImage = false)
{
if (string.IsNullOrEmpty(path))
{
return new ImageResult(_imageCache[Constant.ErrorIcon], ImageType.Error);
return new ImageResult(_imageCache[Constant.MissingImgIcon], ImageType.Error);
}
if (_imageCache.ContainsKey(path))
{
Expand Down Expand Up @@ -139,7 +139,7 @@ private static ImageResult LoadInternal(string path, bool loadFullImage = false)
Log.Exception($"|ImageLoader.Load|Failed to get thumbnail for {path} on first try", e);
Log.Exception($"|ImageLoader.Load|Failed to get thumbnail for {path} on second try", e2);

ImageSource image = _imageCache[Constant.ErrorIcon];
ImageSource image = _imageCache[Constant.MissingImgIcon];
_imageCache[path] = image;
imageResult = new ImageResult(image, ImageType.Error);
}
Expand Down Expand Up @@ -191,8 +191,8 @@ private static ImageResult GetThumbnailResult(ref string path, bool loadFullImag
}
else
{
image = _imageCache[Constant.ErrorIcon];
path = Constant.ErrorIcon;
image = _imageCache[Constant.MissingImgIcon];
path = Constant.MissingImgIcon;
}

if (type != ImageType.Error)
Expand Down
8 changes: 4 additions & 4 deletions Flow.Launcher.Plugin/Flow.Launcher.Plugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
</PropertyGroup>

<PropertyGroup>
<Version>1.2.0</Version>
<PackageVersion>1.2.0</PackageVersion>
<AssemblyVersion>1.2.0</AssemblyVersion>
<FileVersion>1.2.0</FileVersion>
<Version>1.2.1</Version>
<PackageVersion>1.2.1</PackageVersion>
<AssemblyVersion>1.2.1</AssemblyVersion>
<FileVersion>1.2.1</FileVersion>
<PackageId>Flow.Launcher.Plugin</PackageId>
<Authors>Flow-Launcher</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
8 changes: 4 additions & 4 deletions Flow.Launcher.Plugin/SharedCommands/FilesFolders.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public static class FilesFolders
/// </summary>
/// <param name="sourcePath"></param>
/// <param name="targetPath"></param>
public static void Copy(this string sourcePath, string targetPath)
public static void CopyAll(this string sourcePath, string targetPath)
{
// Get the subdirectories for the specified directory.
DirectoryInfo dir = new DirectoryInfo(sourcePath);
Expand Down Expand Up @@ -50,7 +50,7 @@ public static void Copy(this string sourcePath, string targetPath)
foreach (DirectoryInfo subdir in dirs)
{
string temppath = Path.Combine(targetPath, subdir.Name);
Copy(subdir.FullName, temppath);
CopyAll(subdir.FullName, temppath);
}
}
catch (Exception e)
Expand Down Expand Up @@ -114,7 +114,7 @@ public static bool LocationExists(this string path)
return Directory.Exists(path);
}

public static bool FileExits(this string filePath)
public static bool FileExists(this string filePath)
{
return File.Exists(filePath);
}
Expand All @@ -124,7 +124,7 @@ public static void OpenPath(string fileOrFolderPath)
var psi = new ProcessStartInfo { FileName = FileExplorerProgramName, UseShellExecute = true, Arguments = fileOrFolderPath };
try
{
if (LocationExists(fileOrFolderPath) || FileExits(fileOrFolderPath))
if (LocationExists(fileOrFolderPath) || FileExists(fileOrFolderPath))
Process.Start(psi);
}
catch (Exception e)
Expand Down
Binary file added Flow.Launcher/Images/app_missing_img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Flow.Launcher/ViewModel/ResultViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ImageSource Image
catch (Exception e)
{
Log.Exception($"|ResultViewModel.Image|IcoPath is empty and exception when calling Icon() for result <{Result.Title}> of plugin <{Result.PluginDirectory}>", e);
imagePath = Constant.ErrorIcon;
imagePath = Constant.MissingImgIcon;
}
}

Expand Down
1 change: 1 addition & 0 deletions Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<system:String x:Key="plugin_explorer_deletefilefolderconfirm">Are you sure you want to permanently delete this {0}?</system:String>
<system:String x:Key="plugin_explorer_deletefilefoldersuccess">Deletion successful</system:String>
<system:String x:Key="plugin_explorer_deletefilefoldersuccess_detail">Successfully deleted the {0}</system:String>
<system:String x:Key="plugin_explorer_globalActionKeywordInvalid">Assigning the global action keyword could bring up too many results during search. Please choose a specific action keyword</system:String>

<!--Controls-->
<system:String x:Key="plugin_explorer_delete">Delete</system:String>
Expand Down
2 changes: 2 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ internal static class Constants

internal const char AllFilesFolderSearchWildcard = '>';

internal const string DefaultContentSearchActionKeyword = "doc:";

internal const char DirectorySeperator = '\\';

internal const string WindowsIndexingOptions = "srchadmin.dll";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search.FolderLinks
{
public class QuickFolderAccess
{
internal List<Result> FolderList(Query query, List<FolderLink> folderLinks, PluginInitContext context)
internal List<Result> FolderListMatched(Query query, List<FolderLink> folderLinks, PluginInitContext context)
{
if (string.IsNullOrEmpty(query.Search))
return folderLinks
.Select(item =>
new ResultManager(context)
.CreateFolderResult(item.Nickname, item.Path, item.Path, query))
.ToList();
return new List<Result>();

string search = query.Search.ToLower();

Expand All @@ -24,5 +20,11 @@ internal List<Result> FolderList(Query query, List<FolderLink> folderLinks, Plug
.CreateFolderResult(item.Nickname, item.Path, item.Path, query))
.ToList();
}

internal List<Result> FolderListAll(Query query, List<FolderLink> folderLinks, PluginInitContext context)
=> folderLinks
.Select(item =>
new ResultManager(context).CreateFolderResult(item.Nickname, item.Path, item.Path, query))
.ToList();
}
}
29 changes: 19 additions & 10 deletions Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ internal List<Result> Search(Query query)

var querySearch = query.Search;

var quickFolderLinks = quickFolderAccess.FolderList(query, settings.QuickFolderAccessLinks, context);
if (IsFileContentSearch(query.ActionKeyword))
return WindowsIndexFileContentSearch(query, querySearch);

if (quickFolderLinks.Count > 0 && query.ActionKeyword == settings.SearchActionKeyword)
return quickFolderLinks;
// This allows the user to type the assigned action keyword and only see the list of quick folder links
if (settings.QuickFolderAccessLinks.Count > 0
&& query.ActionKeyword == settings.SearchActionKeyword
&& string.IsNullOrEmpty(query.Search))
return quickFolderAccess.FolderListAll(query, settings.QuickFolderAccessLinks, context);

if (string.IsNullOrEmpty(querySearch))
return results;
var quickFolderLinks = quickFolderAccess.FolderListMatched(query, settings.QuickFolderAccessLinks, context);

if (IsFileContentSearch(query.ActionKeyword))
return WindowsIndexFileContentSearch(query, querySearch);
if (quickFolderLinks.Count > 0)
results.AddRange(quickFolderLinks);

var isEnvironmentVariable = EnvironmentVariables.IsEnvironmentVariableSearch(querySearch);

Expand All @@ -54,7 +57,11 @@ internal List<Result> Search(Query query)
var isEnvironmentVariablePath = querySearch.Substring(1).Contains("%\\");

if (!FilesFolders.IsLocationPathString(querySearch) && !isEnvironmentVariablePath)
return WindowsIndexFilesAndFoldersSearch(query, querySearch);
{
results.AddRange(WindowsIndexFilesAndFoldersSearch(query, querySearch));

return results;
}

var locationPath = querySearch;

Expand Down Expand Up @@ -137,15 +144,17 @@ private List<Result> WindowsIndexTopLevelFolderSearch(Query query, string path)

private bool UseWindowsIndexForDirectorySearch(string locationPath)
{
var pathToDirectory = FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath);

if (!settings.UseWindowsIndexForDirectorySearch)
return false;

if (settings.IndexSearchExcludedSubdirectoryPaths
.Any(x => FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath)
.Any(x => FilesFolders.ReturnPreviousDirectoryIfIncompleteString(pathToDirectory)
.StartsWith(x.Path, StringComparison.OrdinalIgnoreCase)))
return false;

return indexSearch.PathIsIndexed(locationPath);
return indexSearch.PathIsIndexed(pathToDirectory);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ internal class IndexSearch
private readonly ResultManager resultManager;

// Reserved keywords in oleDB
private readonly string reservedStringPattern = @"^[\/\\\$\%]+$";
private readonly string reservedStringPattern = @"^[\/\\\$\%_]+$";

internal IndexSearch(PluginInitContext context)
{
Expand Down Expand Up @@ -51,7 +51,12 @@ internal List<Result> ExecuteWindowsIndexSearch(string indexQueryString, string
{
if (dataReaderResults.GetValue(0) != DBNull.Value && dataReaderResults.GetValue(1) != DBNull.Value)
{
var path = new Uri(dataReaderResults.GetString(1)).LocalPath;
// # is URI syntax for the fragment component, need to be encoded so LocalPath returns complete path
var encodedFragmentPath = dataReaderResults
.GetString(1)
.Replace("#", "%23", StringComparison.OrdinalIgnoreCase);

var path = new Uri(encodedFragmentPath).LocalPath;

if (dataReaderResults.GetString(2) == "Directory")
{
Expand Down
Loading