diff --git a/src/modules/imageresizer/ui/ViewModels/MainViewModel.cs b/src/modules/imageresizer/ui/ViewModels/MainViewModel.cs index 8f335e4b1d..64a321ba6a 100644 --- a/src/modules/imageresizer/ui/ViewModels/MainViewModel.cs +++ b/src/modules/imageresizer/ui/ViewModels/MainViewModel.cs @@ -44,7 +44,7 @@ namespace ImageResizer.ViewModels { if (_batch.Files.Count == 0) { - _batch.Files.AddRange(view?.OpenPictureFiles()); + _batch.Files.AddRange(view.OpenPictureFiles()); } CurrentPage = new InputViewModel(_settings, this, view, _batch); diff --git a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Main.cs b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Main.cs index d0ae109e39..ce0d314862 100644 --- a/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Main.cs +++ b/src/modules/launcher/Plugins/Microsoft.PowerToys.Run.Plugin.Calculator/Main.cs @@ -55,15 +55,12 @@ namespace Microsoft.PowerToys.Run.Plugin.Calculator public List Query(Query query) { + ArgumentNullException.ThrowIfNull(query); + bool isGlobalQuery = string.IsNullOrEmpty(query.ActionKeyword); CultureInfo inputCulture = _inputUseEnglishFormat ? new CultureInfo("en-us") : CultureInfo.CurrentCulture; CultureInfo outputCulture = _outputUseEnglishFormat ? new CultureInfo("en-us") : CultureInfo.CurrentCulture; - if (query == null) - { - throw new ArgumentNullException(paramName: nameof(query)); - } - // Happens if the user has only typed the action key so far if (string.IsNullOrEmpty(query.Search)) { diff --git a/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs b/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs index 8d76b10217..63a4084327 100644 --- a/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs +++ b/src/modules/launcher/PowerLauncher/MainWindow.xaml.cs @@ -560,7 +560,7 @@ namespace PowerLauncher // To populate the AutoCompleteTextBox as soon as the selection is changed or set. // Setting it here instead of when the text is changed as there is a delay in executing the query and populating the result - if (_viewModel.Results != null && !string.IsNullOrEmpty(SearchBox.QueryTextBox.Text)) + if (!string.IsNullOrEmpty(SearchBox.QueryTextBox.Text)) { SearchBox.AutoCompleteTextBlock.Text = MainViewModel.GetAutoCompleteText( _viewModel.Results.SelectedIndex, diff --git a/src/modules/launcher/PowerLauncher/Plugin/PluginManager.cs b/src/modules/launcher/PowerLauncher/Plugin/PluginManager.cs index 353a1981c9..9a73221f04 100644 --- a/src/modules/launcher/PowerLauncher/Plugin/PluginManager.cs +++ b/src/modules/launcher/PowerLauncher/Plugin/PluginManager.cs @@ -13,7 +13,6 @@ using System.Reflection; using System.Threading.Tasks; using System.Windows; using global::PowerToys.GPOWrapper; -using ManagedCommon; using PowerLauncher.Properties; using Wox.Infrastructure.Storage; using Wox.Plugin; @@ -60,12 +59,14 @@ namespace PowerLauncher.Plugin { try { - // Return a comparable produce version. + // Return a comparable product version. var fileVersion = FileVersionInfo.GetVersionInfo(x.ExecuteFilePath); - return ((uint)fileVersion.ProductMajorPart << 48) - | ((uint)fileVersion.ProductMinorPart << 32) - | ((uint)fileVersion.ProductBuildPart << 16) - | ((uint)fileVersion.ProductPrivatePart); + + // Convert each part to an unsigned 32 bit integer, then extend to 64 bit. + return ((ulong)(uint)fileVersion.ProductMajorPart << 48) + | ((ulong)(uint)fileVersion.ProductMinorPart << 32) + | ((ulong)(uint)fileVersion.ProductBuildPart << 16) + | (ulong)(uint)fileVersion.ProductPrivatePart; } catch (System.IO.FileNotFoundException) { diff --git a/src/modules/launcher/Wox.Infrastructure/StringMatcher.cs b/src/modules/launcher/Wox.Infrastructure/StringMatcher.cs index f74c4d75b4..4d84d875b6 100644 --- a/src/modules/launcher/Wox.Infrastructure/StringMatcher.cs +++ b/src/modules/launcher/Wox.Infrastructure/StringMatcher.cs @@ -226,9 +226,7 @@ namespace Wox.Infrastructure } else { - int? ind = spaceIndices.OrderBy(item => (firstMatchIndex - item)).Where(item => firstMatchIndex > item).FirstOrDefault(); - int closestSpaceIndex = ind ?? -1; - return closestSpaceIndex; + return spaceIndices.OrderBy(item => (firstMatchIndex - item)).Where(item => firstMatchIndex > item).FirstOrDefault(-1); } } diff --git a/src/settings-ui/Settings.UI/ViewModels/Flyout/LauncherViewModel.cs b/src/settings-ui/Settings.UI/ViewModels/Flyout/LauncherViewModel.cs index 24edda2474..bec41d89b0 100644 --- a/src/settings-ui/Settings.UI/ViewModels/Flyout/LauncherViewModel.cs +++ b/src/settings-ui/Settings.UI/ViewModels/Flyout/LauncherViewModel.cs @@ -48,13 +48,12 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels AddFlyoutMenuItem(ModuleType.MeasureTool); AddFlyoutMenuItem(ModuleType.ShortcutGuide); + updatingSettingsConfig = UpdatingSettings.LoadSettings(); if (updatingSettingsConfig == null) { updatingSettingsConfig = new UpdatingSettings(); } - updatingSettingsConfig = UpdatingSettings.LoadSettings(); - if (updatingSettingsConfig.State == UpdatingSettings.UpdatingState.ReadyToInstall || updatingSettingsConfig.State == UpdatingSettings.UpdatingState.ReadyToDownload) { IsUpdateAvailable = true;