mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
New method to check for environment variable
This commit is contained in:
parent
484eb9cdff
commit
a66b4cd057
1 changed files with 9 additions and 7 deletions
|
|
@ -58,10 +58,12 @@ namespace Flow.Launcher.Plugin.Folder
|
|||
var results = GetUserFolderResults(query);
|
||||
|
||||
string search = query.Search.ToLower();
|
||||
if (!IsDriveOrSharedFolder(search))
|
||||
if (!IsDriveOrSharedFolder(search) && !IsEnvironmentVariableSearch(search))
|
||||
{
|
||||
return results;
|
||||
}
|
||||
|
||||
if (search.StartsWith("%"))
|
||||
if (IsEnvironmentVariableSearch(search))
|
||||
{
|
||||
results.AddRange(GetEnvironmentStringPathResults(search, query));
|
||||
}
|
||||
|
|
@ -79,6 +81,11 @@ namespace Flow.Launcher.Plugin.Folder
|
|||
return results;
|
||||
}
|
||||
|
||||
private static bool IsEnvironmentVariableSearch(string search)
|
||||
{
|
||||
return _envStringPaths != null && search.StartsWith("%");
|
||||
}
|
||||
|
||||
private static bool IsDriveOrSharedFolder(string search)
|
||||
{
|
||||
if (search.StartsWith(@"\\"))
|
||||
|
|
@ -86,11 +93,6 @@ namespace Flow.Launcher.Plugin.Folder
|
|||
return true;
|
||||
}
|
||||
|
||||
if (_envStringPaths != null && search.StartsWith("%"))
|
||||
{ // environment string formatted folder
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_driverNames != null && _driverNames.Any(search.StartsWith))
|
||||
{ // normal drive letter
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue