From 353fa026af9e967083102f08e12e69bfb50f6d46 Mon Sep 17 00:00:00 2001 From: Jeremy Wu Date: Tue, 26 May 2020 21:49:59 +1000 Subject: [PATCH] rename variables and update comment --- .../Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs | 3 +-- .../Search/WindowsIndex/IndexSearch.cs | 4 ++-- .../Search/WindowsIndex/QueryConstructor.cs | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index 19fbdc9e6..703667714 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -37,8 +37,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search return EnvironmentVariables.GetEnvironmentStringPathSuggestions(querySearch, query); } - // Query is a location path with a full environment variable- starts with a % - // and contains another % somewhere before the end of the path + // Query is a location path with a full environment variable, eg. %appdata%\somefolder\ if (querySearch.Substring(1).Contains("%")) { querySearch = EnvironmentVariables.TranslateEnvironmentVariablePath(querySearch); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs index 2648b82be..4f0f8439a 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/IndexSearch.cs @@ -23,7 +23,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex // Reserved keywords in oleDB private string ReservedStringPattern = @"^[\/\\\$\%]+$"; - internal List ExecuteWindowsIndexSearch(string searchString, string connectionString, Query query) + internal List ExecuteWindowsIndexSearch(string indexQueryString, string connectionString, Query query) { var results = new List(); @@ -33,7 +33,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex { conn.Open(); - using (command = new OleDbCommand(searchString, conn)) + using (command = new OleDbCommand(indexQueryString, conn)) { // Results return as an OleDbDataReader. using (dataReaderResults = command.ExecuteReader()) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs index d74a11b48..2c2f197c0 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs @@ -1,4 +1,4 @@ -using Microsoft.Search.Interop; +using Microsoft.Search.Interop; namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex { @@ -57,11 +57,11 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex /// /// Search will be performed on all folders and files on the first level of a specified directory. /// - public string QueryForTopLevelDirectorySearch(string folderPath) + public string QueryForTopLevelDirectorySearch(string path) { string query = "SELECT TOP " + _settings.MaxResult + $" {CreateBaseQuery().QuerySelectColumns} FROM {SystemIndex} WHERE "; - query += QueryWhereRestrictionsForTopLevelDirectorySearch(folderPath); + query += QueryWhereRestrictionsForTopLevelDirectorySearch(path); return query; }