mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add File Content Search Enabled status property
This commit is contained in:
parent
a87cea7e6f
commit
267fb6551b
2 changed files with 13 additions and 8 deletions
|
|
@ -75,10 +75,10 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
keyword == Settings.SearchActionKeyword,
|
||||
Settings.ActionKeyword.PathSearchActionKeyword => Settings.PathSearchKeywordEnabled &&
|
||||
keyword == Settings.PathSearchActionKeyword,
|
||||
Settings.ActionKeyword.FileContentSearchActionKeyword => keyword ==
|
||||
Settings.FileContentSearchActionKeyword,
|
||||
Settings.ActionKeyword.FileContentSearchActionKeyword => Settings.FileContentSearchKeywordEnabled &&
|
||||
keyword == Settings.FileContentSearchActionKeyword,
|
||||
Settings.ActionKeyword.IndexSearchActionKeyword => Settings.IndexOnlySearchKeywordEnabled &&
|
||||
keyword == Settings.IndexSearchActionKeyword
|
||||
keyword == Settings.IndexSearchActionKeyword
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
|
||||
public string FileContentSearchActionKeyword { get; set; } = Constants.DefaultContentSearchActionKeyword;
|
||||
|
||||
public bool FileContentSearchKeywordEnabled { get; set; } = true;
|
||||
|
||||
public string PathSearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
|
||||
|
||||
public bool PathSearchKeywordEnabled { get; set; }
|
||||
|
|
@ -48,7 +50,8 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
ActionKeyword.SearchActionKeyword => SearchActionKeyword,
|
||||
ActionKeyword.PathSearchActionKeyword => PathSearchActionKeyword,
|
||||
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchActionKeyword,
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexSearchActionKeyword
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexSearchActionKeyword,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyWord property not found")
|
||||
};
|
||||
|
||||
internal void SetActionKeyword(ActionKeyword actionKeyword, string keyword) => _ = actionKeyword switch
|
||||
|
|
@ -57,15 +60,16 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
ActionKeyword.PathSearchActionKeyword => PathSearchActionKeyword = keyword,
|
||||
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchActionKeyword = keyword,
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexSearchActionKeyword = keyword,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "Unexpected property")
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyWord property not found")
|
||||
};
|
||||
|
||||
internal bool? GetActionKeywordEnabled(ActionKeyword actionKeyword) => actionKeyword switch
|
||||
internal bool GetActionKeywordEnabled(ActionKeyword actionKeyword) => actionKeyword switch
|
||||
{
|
||||
ActionKeyword.SearchActionKeyword => SearchActionKeywordEnabled,
|
||||
ActionKeyword.PathSearchActionKeyword => PathSearchKeywordEnabled,
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexOnlySearchKeywordEnabled,
|
||||
_ => null
|
||||
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchKeywordEnabled,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyword enabled status not defined")
|
||||
};
|
||||
|
||||
internal void SetActionKeywordEnabled(ActionKeyword actionKeyword, bool enable) => _ = actionKeyword switch
|
||||
|
|
@ -73,7 +77,8 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
ActionKeyword.SearchActionKeyword => SearchActionKeywordEnabled = enable,
|
||||
ActionKeyword.PathSearchActionKeyword => PathSearchKeywordEnabled = enable,
|
||||
ActionKeyword.IndexSearchActionKeyword => IndexOnlySearchKeywordEnabled = enable,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "Unexpected property")
|
||||
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchKeywordEnabled = enable,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "ActionKeyword enabled status not defined")
|
||||
};
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue