From 37a4eefc4669dd8c6138fb47d05eeb828fb0fd83 Mon Sep 17 00:00:00 2001 From: AT <14300910+theClueless@users.noreply.github.com> Date: Mon, 9 Dec 2019 00:26:21 +0200 Subject: [PATCH] updated to use share folder --- Plugins/Wox.Plugin.Folder/Main.cs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Plugins/Wox.Plugin.Folder/Main.cs b/Plugins/Wox.Plugin.Folder/Main.cs index b5c122b106..f36029cb8f 100644 --- a/Plugins/Wox.Plugin.Folder/Main.cs +++ b/Plugins/Wox.Plugin.Folder/Main.cs @@ -44,7 +44,7 @@ namespace Wox.Plugin.Folder var results = GetUserFolderResults(query); string search = query.Search.ToLower(); - if (_driverNames != null && !_driverNames.Any(search.StartsWith)) + if (!IsDriveOrSharedFolder(search)) return results; results.AddRange(QueryInternal_Directory_Exists(query)); @@ -58,6 +58,26 @@ namespace Wox.Plugin.Folder return results; } + private static bool IsDriveOrSharedFolder(string search) + { + if (search.StartsWith(@"\\")) + { + return true; + } + + if (_driverNames != null && _driverNames.Any(search.StartsWith)) + { + return true; + } + + if (_driverNames == null && search.Length > 2 && char.IsLetter(search[0]) && search[1] == ':') + { + return true; // we don't know so let's give it the possibility + } + + return false; + } + private Result CreateFolderResult(string title, string path) { return new Result