Skip to content

Commit 625ddbc

Browse files
committed
Code quality
1 parent 8b44b08 commit 625ddbc

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/QueryConstructor.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ public class QueryConstructor
99
private static Regex _specialCharacterMatcher = new(@"[\@\@\#\#\&\&*_;,\%\|\!\(\)\{\}\[\]\^\~\?\\""\/\:\=\-]+", RegexOptions.Compiled);
1010
private static Regex _multiWhiteSpacesMatcher = new(@"\s+", RegexOptions.Compiled);
1111

12-
private Settings settings { get; }
12+
private Settings Settings { get; }
1313

1414
private const string SystemIndex = "SystemIndex";
1515

1616
public QueryConstructor(Settings settings)
1717
{
18-
this.settings = settings;
18+
Settings = settings;
1919
}
2020

2121
public CSearchQueryHelper CreateBaseQuery()
2222
{
2323
var baseQuery = CreateQueryHelper();
2424

2525
// Set the number of results we want. Don't set this property if all results are needed.
26-
baseQuery.QueryMaxResults = settings.MaxResult;
26+
baseQuery.QueryMaxResults = Settings.MaxResult;
2727

2828
// Set list of columns we want to display, getting the path presently
2929
baseQuery.QuerySelectColumns = "System.FileName, System.ItemUrl, System.ItemType";
@@ -37,7 +37,7 @@ public CSearchQueryHelper CreateBaseQuery()
3737
return baseQuery;
3838
}
3939

40-
internal CSearchQueryHelper CreateQueryHelper()
40+
internal static CSearchQueryHelper CreateQueryHelper()
4141
{
4242
// This uses the Microsoft.Search.Interop assembly
4343
// Throws COMException if Windows Search service is not running/disabled, this needs to be caught
@@ -66,7 +66,7 @@ public string Directory(ReadOnlySpan<char> path, ReadOnlySpan<char> searchString
6666
? RecursiveDirectoryConstraint(path)
6767
: TopLevelDirectoryConstraint(path);
6868

69-
var query = $"SELECT TOP {settings.MaxResult} {CreateBaseQuery().QuerySelectColumns} FROM {SystemIndex} WHERE {scopeConstraint} {queryConstraint} ORDER BY {OrderIdentifier}";
69+
var query = $"SELECT TOP {Settings.MaxResult} {CreateBaseQuery().QuerySelectColumns} FROM {SystemIndex} WHERE {scopeConstraint} {queryConstraint} ORDER BY {OrderIdentifier}";
7070

7171
return query;
7272
}
@@ -133,7 +133,7 @@ private static string ReplaceSpecialCharacterWithTwoSideWhiteSpace(ReadOnlySpan<
133133
public string FileContent(ReadOnlySpan<char> userSearchString)
134134
{
135135
string query =
136-
$"SELECT TOP {settings.MaxResult} {CreateBaseQuery().QuerySelectColumns} FROM {SystemIndex} WHERE {RestrictionsForFileContentSearch(userSearchString)} AND {RestrictionsForAllFilesAndFoldersSearch} ORDER BY {OrderIdentifier}";
136+
$"SELECT TOP {Settings.MaxResult} {CreateBaseQuery().QuerySelectColumns} FROM {SystemIndex} WHERE {RestrictionsForFileContentSearch(userSearchString)} AND {RestrictionsForAllFilesAndFoldersSearch} ORDER BY {OrderIdentifier}";
137137

138138
return query;
139139
}

0 commit comments

Comments
 (0)