Skip to content

Commit f13e24b

Browse files
committed
removed obsolete api object, updated search action keyword naming,
1 parent 002c27f commit f13e24b

File tree

6 files changed

+18
-21
lines changed

6 files changed

+18
-21
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@
1919
<system:String x:Key="plugin_explorer_quickaccesslinks_header">Quick Access Links</system:String>
2020
<system:String x:Key="plugin_explorer_indexsearchexcludedpaths_header">Index Search Excluded Paths</system:String>
2121
<system:String x:Key="plugin_explorer_manageindexoptions">Indexing Options</system:String>
22-
<system:String x:Key="plugin_explorer_actionkeywordview_search">Index Search Activation:</system:String>
23-
<system:String x:Key="plugin_explorer_actionkeywordview_path">Path Explore Activation:</system:String>
22+
<system:String x:Key="plugin_explorer_actionkeywordview_search">Search:</system:String>
23+
<system:String x:Key="plugin_explorer_actionkeywordview_path">Path Search:</system:String>
2424
<system:String x:Key="plugin_explorer_actionkeywordview_filecontentsearch">File Content Search:</system:String>
25-
<system:String x:Key="plugin_explorer_actionkeywordview_indexonlysearch">Index Only Search:</system:String>
26-
<system:String x:Key="plugin_explorer_actionkeywordview_brackets_disabled">(Disabled)</system:String>
25+
<system:String x:Key="plugin_explorer_actionkeywordview_indexonlysearch">Index Search:</system:String>
2726

2827
<!--Plugin Infos-->
2928
<system:String x:Key="plugin_explorer_plugin_name">Explorer</system:String>

Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ internal async Task<List<Result>> SearchAsync(Query query, CancellationToken tok
5353
result.UnionWith(await PathSearchAsync(query, token).ConfigureAwait(false));
5454
}
5555

56-
if ((ActionKeywordMatch(query, Settings.ActionKeyword.IndexOnlySearchActionKeyword) ||
56+
if ((ActionKeywordMatch(query, Settings.ActionKeyword.IndexSearchActionKeyword) ||
5757
ActionKeywordMatch(query, Settings.ActionKeyword.SearchActionKeyword)) &&
5858
querySearch.Length > 0 &&
5959
!querySearch.IsLocationPathString())
@@ -77,8 +77,8 @@ private bool ActionKeywordMatch(Query query, Settings.ActionKeyword allowedActio
7777
keyword == settings.PathSearchActionKeyword,
7878
Settings.ActionKeyword.FileContentSearchActionKeyword => keyword ==
7979
settings.FileContentSearchActionKeyword,
80-
Settings.ActionKeyword.IndexOnlySearchActionKeyword => settings.EnabledIndexOnlySearchKeyword &&
81-
keyword == settings.IndexOnlySearchActionKeyword
80+
Settings.ActionKeyword.IndexSearchActionKeyword => settings.EnabledIndexOnlySearchKeyword &&
81+
keyword == settings.IndexSearchActionKeyword
8282
};
8383
}
8484

Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class Settings
2929

3030
public bool EnabledPathSearchKeyword { get; set; }
3131

32-
public string IndexOnlySearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
32+
public string IndexSearchActionKeyword { get; set; } = Query.GlobalPluginWildcardSign;
3333

3434
public bool EnabledIndexOnlySearchKeyword { get; set; }
3535

@@ -38,39 +38,39 @@ internal enum ActionKeyword
3838
SearchActionKeyword,
3939
PathSearchActionKeyword,
4040
FileContentSearchActionKeyword,
41-
IndexOnlySearchActionKeyword
41+
IndexSearchActionKeyword
4242
}
4343

4444
internal string GetActionKeyword(ActionKeyword actionKeyword) => actionKeyword switch
4545
{
4646
ActionKeyword.SearchActionKeyword => SearchActionKeyword,
4747
ActionKeyword.PathSearchActionKeyword => PathSearchActionKeyword,
4848
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchActionKeyword,
49-
ActionKeyword.IndexOnlySearchActionKeyword => IndexOnlySearchActionKeyword
49+
ActionKeyword.IndexSearchActionKeyword => IndexSearchActionKeyword
5050
};
5151

5252
internal void SetActionKeyword(ActionKeyword actionKeyword, string keyword) => _ = actionKeyword switch
5353
{
5454
ActionKeyword.SearchActionKeyword => SearchActionKeyword = keyword,
5555
ActionKeyword.PathSearchActionKeyword => PathSearchActionKeyword = keyword,
5656
ActionKeyword.FileContentSearchActionKeyword => FileContentSearchActionKeyword = keyword,
57-
ActionKeyword.IndexOnlySearchActionKeyword => IndexOnlySearchActionKeyword = keyword,
57+
ActionKeyword.IndexSearchActionKeyword => IndexSearchActionKeyword = keyword,
5858
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "Unexpected property")
5959
};
6060

6161
internal bool? GetActionKeywordEnable(ActionKeyword actionKeyword) => actionKeyword switch
6262
{
6363
ActionKeyword.SearchActionKeyword => EnableSearchActionKeyword,
6464
ActionKeyword.PathSearchActionKeyword => EnabledPathSearchKeyword,
65-
ActionKeyword.IndexOnlySearchActionKeyword => EnabledIndexOnlySearchKeyword,
65+
ActionKeyword.IndexSearchActionKeyword => EnabledIndexOnlySearchKeyword,
6666
_ => null
6767
};
6868

6969
internal void SetActionKeywordEnable(ActionKeyword actionKeyword, bool enable) => _ = actionKeyword switch
7070
{
7171
ActionKeyword.SearchActionKeyword => EnableSearchActionKeyword = enable,
7272
ActionKeyword.PathSearchActionKeyword => EnabledPathSearchKeyword = enable,
73-
ActionKeyword.IndexOnlySearchActionKeyword => EnabledIndexOnlySearchKeyword = enable,
73+
ActionKeyword.IndexSearchActionKeyword => EnabledIndexOnlySearchKeyword = enable,
7474
_ => throw new ArgumentOutOfRangeException(nameof(actionKeyword), actionKeyword, "Unexpected property")
7575
};
7676
}

Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ internal void UpdateActionKeyword(Settings.ActionKeyword modifiedActionKeyword,
5656
case Settings.ActionKeyword.FileContentSearchActionKeyword:
5757
Settings.FileContentSearchActionKeyword = newActionKeyword;
5858
break;
59-
case Settings.ActionKeyword.IndexOnlySearchActionKeyword:
60-
Settings.IndexOnlySearchActionKeyword = newActionKeyword;
59+
case Settings.ActionKeyword.IndexSearchActionKeyword:
60+
Settings.IndexSearchActionKeyword = newActionKeyword;
6161
break;
6262
}
6363
}

Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private void OnConfirmButtonClick(object sender, RoutedEventArgs e)
7373
newActionKeyword;
7474

7575
// automatically help users set this to enabled if an action keyword is set and currently disabled
76-
if (CurrentActionKeyword.KeywordProperty == Settings.ActionKeyword.IndexOnlySearchActionKeyword
76+
if (CurrentActionKeyword.KeywordProperty == Settings.ActionKeyword.IndexSearchActionKeyword
7777
&& !settings.EnabledIndexOnlySearchKeyword)
7878
settings.EnabledIndexOnlySearchKeyword = true;
7979

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ public ExplorerSettings(SettingsViewModel viewModel)
4141
viewModel.Context.API.GetTranslation("plugin_explorer_actionkeywordview_filecontentsearch")),
4242
new(Settings.ActionKeyword.PathSearchActionKeyword,
4343
viewModel.Context.API.GetTranslation("plugin_explorer_actionkeywordview_path")),
44-
new(Settings.ActionKeyword.IndexOnlySearchActionKeyword,
44+
new(Settings.ActionKeyword.IndexSearchActionKeyword,
4545
viewModel.Context.API.GetTranslation("plugin_explorer_actionkeywordview_indexonlysearch"))
4646
};
4747

4848
lbxActionKeywords.ItemsSource = actionKeywordsListView;
4949

50-
ActionKeywordView.Init(viewModel.Settings, viewModel.Context.API);
50+
ActionKeywordView.Init(viewModel.Settings);
5151

5252
RefreshView();
5353
}
@@ -312,12 +312,10 @@ private void btnOpenIndexingOptions_Click(object sender, RoutedEventArgs e)
312312
public class ActionKeywordView
313313
{
314314
private static Settings _settings;
315-
private static IPublicAPI _api;
316315

317-
public static void Init(Settings settings, IPublicAPI api)
316+
public static void Init(Settings settings)
318317
{
319318
_settings = settings;
320-
_api = api;
321319
}
322320

323321
internal ActionKeywordView(Settings.ActionKeyword actionKeyword, string description)

0 commit comments

Comments
 (0)