From 0df9f373ce8a06bc3211f8bc94bc996691c65523 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Sat, 3 Jul 2021 12:45:00 +0800 Subject: [PATCH] Rename variables --- .../Search/ResultManager.cs | 4 ++-- .../Search/SearchManager.cs | 6 +++--- .../Flow.Launcher.Plugin.Explorer/Settings.cs | 18 +++++++++--------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs index 47a5a006c..d0f78e14d 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs @@ -28,7 +28,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search TitleHighlightData = StringMatcher.FuzzySearch(query.Search, title).MatchData, Action = c => { - if (c.SpecialKeyState.CtrlPressed || (!Settings.EnabledPathSearchKeyword && !Settings.EnabledSearchActionKeyword)) + if (c.SpecialKeyState.CtrlPressed || (!Settings.PathSearchKeywordEnabled && !Settings.SearchActionKeywordEnabled)) { try { @@ -42,7 +42,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search } } // one of it is enabled - var keyword = Settings.EnabledSearchActionKeyword ? Settings.SearchActionKeyword : Settings.PathSearchActionKeyword; + var keyword = Settings.SearchActionKeywordEnabled ? Settings.SearchActionKeyword : Settings.PathSearchActionKeyword; keyword = keyword == Query.GlobalPluginWildcardSign ? string.Empty : keyword + " "; diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs index d98c5400a..2aa389f89 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs @@ -71,13 +71,13 @@ namespace Flow.Launcher.Plugin.Explorer.Search return allowedActionKeyword switch { - Settings.ActionKeyword.SearchActionKeyword => settings.EnabledSearchActionKeyword && + Settings.ActionKeyword.SearchActionKeyword => settings.SearchActionKeywordEnabled && keyword == settings.SearchActionKeyword, - Settings.ActionKeyword.PathSearchActionKeyword => settings.EnabledPathSearchKeyword && + Settings.ActionKeyword.PathSearchActionKeyword => settings.PathSearchKeywordEnabled && keyword == settings.PathSearchActionKeyword, Settings.ActionKeyword.FileContentSearchActionKeyword => keyword == settings.FileContentSearchActionKeyword, - Settings.ActionKeyword.IndexSearchActionKeyword => settings.EnabledIndexOnlySearchKeyword && + Settings.ActionKeyword.IndexSearchActionKeyword => settings.IndexOnlySearchKeywordEnabled && keyword == settings.IndexSearchActionKeyword }; } diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs index 26204616a..985cb2fd9 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs @@ -21,17 +21,17 @@ namespace Flow.Launcher.Plugin.Explorer public List IndexSearchExcludedSubdirectoryPaths { get; set; } = new List(); public string SearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign; - public bool EnabledSearchActionKeyword { get; set; } = true; + public bool SearchActionKeywordEnabled { get; set; } = true; public string FileContentSearchActionKeyword { get; set; } = Constants.DefaultContentSearchActionKeyword; public string PathSearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign; - public bool EnabledPathSearchKeyword { get; set; } + public bool PathSearchKeywordEnabled { get; set; } public string IndexSearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign; - public bool EnabledIndexOnlySearchKeyword { get; set; } + public bool IndexOnlySearchKeywordEnabled { get; set; } internal enum ActionKeyword { @@ -60,17 +60,17 @@ namespace Flow.Launcher.Plugin.Explorer internal bool? GetActionKeywordEnable(ActionKeyword actionKeyword) => actionKeyword switch { - ActionKeyword.SearchActionKeyword => EnabledSearchActionKeyword, - ActionKeyword.PathSearchActionKeyword => EnabledPathSearchKeyword, - ActionKeyword.IndexSearchActionKeyword => EnabledIndexOnlySearchKeyword, + ActionKeyword.SearchActionKeyword => SearchActionKeywordEnabled, + ActionKeyword.PathSearchActionKeyword => PathSearchKeywordEnabled, + ActionKeyword.IndexSearchActionKeyword => IndexOnlySearchKeywordEnabled, _ => null }; internal void SetActionKeywordEnable(ActionKeyword actionKeyword, bool enable) => _ = actionKeyword switch { - ActionKeyword.SearchActionKeyword => EnabledSearchActionKeyword = enable, - ActionKeyword.PathSearchActionKeyword => EnabledPathSearchKeyword = enable, - ActionKeyword.IndexSearchActionKeyword => EnabledIndexOnlySearchKeyword = enable, + ActionKeyword.SearchActionKeyword => SearchActionKeywordEnabled = enable, + ActionKeyword.PathSearchActionKeyword => PathSearchKeywordEnabled = enable, + ActionKeyword.IndexSearchActionKeyword => IndexOnlySearchKeywordEnabled = enable, _ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "Unexpected property") }; }