From 6dead9934156f687702afae776819ebcec92a4b9 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Thu, 9 Mar 2023 12:29:23 -0600 Subject: [PATCH] PR nits --- src/cascadia/TerminalApp/AppLogic.cpp | 7 ++++--- src/cascadia/TerminalApp/SettingsLoadEventArgs.h | 12 ++++++------ src/cascadia/TerminalApp/TerminalPage.cpp | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/cascadia/TerminalApp/AppLogic.cpp b/src/cascadia/TerminalApp/AppLogic.cpp index 9af911a7813..1fbac932e68 100644 --- a/src/cascadia/TerminalApp/AppLogic.cpp +++ b/src/cascadia/TerminalApp/AppLogic.cpp @@ -200,7 +200,8 @@ namespace winrt::TerminalApp::implementation // These used to be in `TerminalPage::Initialized`, so that they started // _after_ the Terminal window was started and displayed. These could - // theoretically move there again too. + // theoretically move there again too. TODO:GH#14957 - evaluate moving + // this after the Page is initialized { // Both LoadSettings and ReloadSettings are supposed to call this function, // but LoadSettings skips it, so that the UI starts up faster. @@ -232,7 +233,7 @@ namespace winrt::TerminalApp::implementation TraceLoggingKeyword(MICROSOFT_KEYWORD_MEASURES), TelemetryPrivacyDataTag(PDT_ProductAndServiceUsage)); } - }; + } _ApplyLanguageSettingChange(); _ApplyStartupTaskStateChange(); @@ -298,7 +299,7 @@ namespace winrt::TerminalApp::implementation _settings = std::move(newSettings); - hr = (_warnings.size()) == 0u ? S_OK : S_FALSE; + hr = _warnings.empty() ? S_OK : S_FALSE; } catch (const winrt::hresult_error& e) { diff --git a/src/cascadia/TerminalApp/SettingsLoadEventArgs.h b/src/cascadia/TerminalApp/SettingsLoadEventArgs.h index e31dd5e2a91..e094810784b 100644 --- a/src/cascadia/TerminalApp/SettingsLoadEventArgs.h +++ b/src/cascadia/TerminalApp/SettingsLoadEventArgs.h @@ -18,13 +18,13 @@ namespace winrt::TerminalApp::implementation public: SettingsLoadEventArgs(bool reload, uint64_t result, - const winrt::hstring& exceptionText, - const winrt::Windows::Foundation::Collections::IVector& warnings, - const Microsoft::Terminal::Settings::Model::CascadiaSettings& newSettings) : + winrt::hstring exceptionText, + winrt::Windows::Foundation::Collections::IVector warnings, + Microsoft::Terminal::Settings::Model::CascadiaSettings newSettings) : _Reload{ reload }, _Result{ result }, - _ExceptionText{ exceptionText }, - _Warnings{ warnings }, - _NewSettings{ newSettings } {}; + _ExceptionText{ std::move(exceptionText) }, + _Warnings{ std::move(warnings) }, + _NewSettings{ std::move(newSettings) } {}; }; } diff --git a/src/cascadia/TerminalApp/TerminalPage.cpp b/src/cascadia/TerminalApp/TerminalPage.cpp index 9361f533460..fd299249ab3 100644 --- a/src/cascadia/TerminalApp/TerminalPage.cpp +++ b/src/cascadia/TerminalApp/TerminalPage.cpp @@ -1799,7 +1799,7 @@ namespace winrt::TerminalApp::implementation } // If the user set a custom name, save it - if (const auto windowName = _WindowProperties.WindowName(); !windowName.empty()) + if (const auto& windowName{ _WindowProperties.WindowName() }; !windowName.empty()) { ActionAndArgs action; action.Action(ShortcutAction::RenameWindow); @@ -3927,7 +3927,7 @@ namespace winrt::TerminalApp::implementation else if (key == Windows::System::VirtualKey::Escape) { // User wants to discard the changes they made - WindowRenamerTextBox().Text(WindowProperties().WindowName()); + WindowRenamerTextBox().Text(_WindowProperties.WindowName()); WindowRenamer().IsOpen(false); _renamerPressedEnter = false; }