make it become an extension method

This commit is contained in:
弘韬 张 2021-01-22 16:22:52 +08:00
parent b426dd10d1
commit 3effb401b7
2 changed files with 3 additions and 3 deletions

View file

@ -148,7 +148,7 @@ namespace Flow.Launcher.Plugin.SharedCommands
/// This checks whether a given string is a directory path or network location string. /// This checks whether a given string is a directory path or network location string.
/// It does not check if location actually exists. /// It does not check if location actually exists.
///</summary> ///</summary>
public static bool IsLocationPathString(string querySearchString) public static bool IsLocationPathString(this string querySearchString)
{ {
if (string.IsNullOrEmpty(querySearchString) || querySearchString.Length < 3) if (string.IsNullOrEmpty(querySearchString) || querySearchString.Length < 3)
return false; return false;

View file

@ -58,7 +58,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
// Query is a location path with a full environment variable, eg. %appdata%\somefolder\ // Query is a location path with a full environment variable, eg. %appdata%\somefolder\
var isEnvironmentVariablePath = querySearch[1..].Contains("%\\"); var isEnvironmentVariablePath = querySearch[1..].Contains("%\\");
if (!FilesFolders.IsLocationPathString(querySearch) && !isEnvironmentVariablePath) if (!querySearch.IsLocationPathString() && !isEnvironmentVariablePath)
{ {
results.AddRange(await WindowsIndexFilesAndFoldersSearchAsync(query, querySearch, token).ConfigureAwait(false)); results.AddRange(await WindowsIndexFilesAndFoldersSearchAsync(query, querySearch, token).ConfigureAwait(false));
@ -70,7 +70,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
if (isEnvironmentVariablePath) if (isEnvironmentVariablePath)
locationPath = EnvironmentVariables.TranslateEnvironmentVariablePath(locationPath); locationPath = EnvironmentVariables.TranslateEnvironmentVariablePath(locationPath);
if (!FilesFolders.LocationExists(FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath))) if (!FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath).IsLocationPathString())
return results; return results;
var useIndexSearch = UseWindowsIndexForDirectorySearch(locationPath); var useIndexSearch = UseWindowsIndexForDirectorySearch(locationPath);