rename variables and update comment

This commit is contained in:
Jeremy Wu 2020-05-26 21:49:59 +10:00
parent 3caafa325f
commit 353fa026af
3 changed files with 6 additions and 7 deletions

View file

@ -37,8 +37,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
return EnvironmentVariables.GetEnvironmentStringPathSuggestions(querySearch, query); return EnvironmentVariables.GetEnvironmentStringPathSuggestions(querySearch, query);
} }
// Query is a location path with a full environment variable- starts with a % // Query is a location path with a full environment variable, eg. %appdata%\somefolder\
// and contains another % somewhere before the end of the path
if (querySearch.Substring(1).Contains("%")) if (querySearch.Substring(1).Contains("%"))
{ {
querySearch = EnvironmentVariables.TranslateEnvironmentVariablePath(querySearch); querySearch = EnvironmentVariables.TranslateEnvironmentVariablePath(querySearch);

View file

@ -23,7 +23,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex
// Reserved keywords in oleDB // Reserved keywords in oleDB
private string ReservedStringPattern = @"^[\/\\\$\%]+$"; private string ReservedStringPattern = @"^[\/\\\$\%]+$";
internal List<Result> ExecuteWindowsIndexSearch(string searchString, string connectionString, Query query) internal List<Result> ExecuteWindowsIndexSearch(string indexQueryString, string connectionString, Query query)
{ {
var results = new List<Result>(); var results = new List<Result>();
@ -33,7 +33,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex
{ {
conn.Open(); conn.Open();
using (command = new OleDbCommand(searchString, conn)) using (command = new OleDbCommand(indexQueryString, conn))
{ {
// Results return as an OleDbDataReader. // Results return as an OleDbDataReader.
using (dataReaderResults = command.ExecuteReader()) using (dataReaderResults = command.ExecuteReader())

View file

@ -1,4 +1,4 @@
using Microsoft.Search.Interop; using Microsoft.Search.Interop;
namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex
{ {
@ -57,11 +57,11 @@ namespace Flow.Launcher.Plugin.Explorer.Search.WindowsIndex
///<summary> ///<summary>
/// Search will be performed on all folders and files on the first level of a specified directory. /// Search will be performed on all folders and files on the first level of a specified directory.
///</summary> ///</summary>
public string QueryForTopLevelDirectorySearch(string folderPath) public string QueryForTopLevelDirectorySearch(string path)
{ {
string query = "SELECT TOP " + _settings.MaxResult + $" {CreateBaseQuery().QuerySelectColumns} FROM {SystemIndex} WHERE "; string query = "SELECT TOP " + _settings.MaxResult + $" {CreateBaseQuery().QuerySelectColumns} FROM {SystemIndex} WHERE ";
query += QueryWhereRestrictionsForTopLevelDirectorySearch(folderPath); query += QueryWhereRestrictionsForTopLevelDirectorySearch(path);
return query; return query;
} }