mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
update old hotkey trigger to use ActionKeyword
This commit is contained in:
parent
a1e371b7e8
commit
ace9dc7f2c
2 changed files with 5 additions and 13 deletions
|
|
@ -28,7 +28,5 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
|
||||
internal static string ExplorerIconImageFullPath
|
||||
=> Directory.GetParent(Assembly.GetExecutingAssembly().Location.ToString()) + "\\" + ExplorerIconImagePath;
|
||||
|
||||
internal const string WindowsIndexFileContentSearchHotkey = "content:";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
if (string.IsNullOrEmpty(querySearch))
|
||||
return results;
|
||||
|
||||
if (IsFileContentSearch(querySearch))
|
||||
if (IsFileContentSearch(query.ActionKeyword))
|
||||
return WindowsIndexFileContentSearch(query, querySearch);
|
||||
|
||||
var isEnvironmentVariable = EnvironmentVariables.IsEnvironmentVariableSearch(querySearch);
|
||||
|
|
@ -81,24 +81,18 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
{
|
||||
var queryConstructor = new QueryConstructor(settings);
|
||||
|
||||
var updatedQuerySearchString = querySearchString
|
||||
.Substring(querySearchString
|
||||
.IndexOf(Constants.WindowsIndexFileContentSearchHotkey)
|
||||
+ Constants.WindowsIndexFileContentSearchHotkey.Length);
|
||||
|
||||
if (string.IsNullOrEmpty(updatedQuerySearchString))
|
||||
if (string.IsNullOrEmpty(querySearchString))
|
||||
return new List<Result>();
|
||||
|
||||
return indexSearch.WindowsIndexSearch(updatedQuerySearchString.TrimStart(),
|
||||
return indexSearch.WindowsIndexSearch(querySearchString,
|
||||
queryConstructor.CreateQueryHelper().ConnectionString,
|
||||
queryConstructor.QueryForFileContentSearch,
|
||||
query);
|
||||
}
|
||||
|
||||
public bool IsFileContentSearch(string querySearch)
|
||||
public bool IsFileContentSearch(string actionKeyword)
|
||||
{
|
||||
return querySearch.StartsWith(Constants.WindowsIndexFileContentSearchHotkey,
|
||||
StringComparison.OrdinalIgnoreCase);
|
||||
return actionKeyword == settings.FileContentSearchActionKeyword;
|
||||
}
|
||||
|
||||
private List<Result> DirectoryInfoClassSearch(Query query, string querySearch)
|
||||
|
|
|
|||
Loading…
Reference in a new issue