From 32268890b964e4e125ba81973541aa9588f05335 Mon Sep 17 00:00:00 2001 From: Vic <10308169+VictoriousRaptor@users.noreply.github.com> Date: Thu, 19 Jan 2023 20:23:33 +0800 Subject: [PATCH] Remove TranslateEnvironmentVariablePath --- .../Search/EnvironmentVariables.cs | 5 ----- .../Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs index 3d6a1ad8a..c17277112 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/EnvironmentVariables.cs @@ -60,11 +60,6 @@ namespace Flow.Launcher.Plugin.Explorer.Search return envStringPaths; } - internal static string TranslateEnvironmentVariablePath(string environmentVariablePath) - { - return Environment.ExpandEnvironmentVariables(environmentVariablePath); - } - internal static List GetEnvironmentStringPathSuggestions(string querySearch, Query query, PluginInitContext context) { var results = new List(); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index da6509124..25604cf2f 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -178,11 +178,11 @@ namespace Flow.Launcher.Plugin.Explorer.Search // Query is a location path with a full environment variable, eg. %appdata%\somefolder\ var isEnvironmentVariablePath = EnvironmentVariables.BeginsWithEnvironmentVar(querySearch); - + var locationPath = querySearch; if (isEnvironmentVariablePath) - locationPath = EnvironmentVariables.TranslateEnvironmentVariablePath(locationPath); + locationPath = Environment.ExpandEnvironmentVariables(locationPath); // Check that actual location exists, otherwise directory search will throw directory not found exception if (!FilesFolders.ReturnPreviousDirectoryIfIncompleteString(locationPath).LocationExists())