diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs index 857e8ac42..90eaa3a04 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Main.cs @@ -1,14 +1,11 @@ -using Flow.Launcher.Infrastructure.Storage; -using Flow.Launcher.Plugin.Explorer.Helper; +using Flow.Launcher.Plugin.Explorer.Helper; using Flow.Launcher.Plugin.Explorer.Search; using Flow.Launcher.Plugin.Explorer.Search.Everything; -using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks; using Flow.Launcher.Plugin.Explorer.ViewModels; using Flow.Launcher.Plugin.Explorer.Views; using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Threading; using System.Threading.Tasks; using System.Windows; @@ -55,7 +52,7 @@ namespace Flow.Launcher.Plugin.Explorer Settings.EverythingInstalledPath = s.Result; }, TaskScheduler.Default); } - + SortOptionTranslationHelper.API = context.API; EverythingApiDllImport.Load(Path.Combine(Context.CurrentPluginMetadata.PluginDirectory, "EverythingSDK", diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs index d7e588f1f..5975d3f16 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ViewModels/SettingsViewModel.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using System.Windows; @@ -82,15 +83,21 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels } } + [MemberNotNull(nameof(IndexSearchEngines), + nameof(ContentIndexSearchEngines), + nameof(PathEnumerationEngines), + nameof(_selectedIndexSearchEngine), + nameof(_selectedContentSearchEngine), + nameof(_selectedPathEnumerationEngine))] private void InitializeEngineSelection() { IndexSearchEngines = EnumBindingModel.CreateList(); ContentIndexSearchEngines = EnumBindingModel.CreateList(); PathEnumerationEngines = EnumBindingModel.CreateList(); - SelectedIndexSearchEngine = IndexSearchEngines.First(x => x.Value == Settings.IndexSearchEngine); - SelectedContentSearchEngine = ContentIndexSearchEngines.First(x => x.Value == Settings.ContentSearchEngine); - SelectedPathEnumerationEngine = PathEnumerationEngines.First(x => x.Value == Settings.PathEnumerationEngine); + _selectedIndexSearchEngine = IndexSearchEngines.First(x => x.Value == Settings.IndexSearchEngine); + _selectedContentSearchEngine = ContentIndexSearchEngines.First(x => x.Value == Settings.ContentSearchEngine); + _selectedPathEnumerationEngine = PathEnumerationEngines.First(x => x.Value == Settings.PathEnumerationEngine); } #endregion @@ -99,6 +106,7 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels #region ActionKeyword + [MemberNotNull(nameof(ActionKeywordsModels))] private void InitializeActionKeywordModels() { ActionKeywordsModels = new List @@ -307,7 +315,7 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels Process.Start(psi); } - private ICommand _openEditorPathCommand; + private ICommand? _openEditorPathCommand; public ICommand OpenEditorPath => _openEditorPathCommand ??= new RelayCommand(_ => { @@ -318,7 +326,7 @@ namespace Flow.Launcher.Plugin.Explorer.ViewModels EditorPath = path; }); - private ICommand _openShellPathCommand; + private ICommand? _openShellPathCommand; public ICommand OpenShellPath => _openShellPathCommand ??= new RelayCommand(_ => {