From f193948f4e158d3f0b8baa7879d4f8576af3d9fc Mon Sep 17 00:00:00 2001 From: mjk Date: Sat, 6 Mar 2021 00:30:06 +0000 Subject: [PATCH] constify all the things --- .../windows-notification/api/src/shortcutcreator.cpp | 10 ++++------ plugins/windows-notification/api/src/win32.cpp | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/plugins/windows-notification/api/src/shortcutcreator.cpp b/plugins/windows-notification/api/src/shortcutcreator.cpp index 8a8cc3b9..cbbce8f4 100644 --- a/plugins/windows-notification/api/src/shortcutcreator.cpp +++ b/plugins/windows-notification/api/src/shortcutcreator.cpp @@ -128,19 +128,17 @@ int32_t ValidateShortcut(const std::wstring& shortcut_path, const std::wstring& static bool ImplEnsureAumiddedShortcutExists( const std::string_view menu_rel_path, const std::string_view aumid) { - auto waumid = sview_to_wstr(aumid); + const auto waumid = sview_to_wstr(aumid); if (waumid.empty()) { return false; } - auto exePath = GetExePath(); - - auto path = GetEnv(L"APPDATA") + LR"(\Microsoft\Windows\Start Menu\)" + const auto path = GetEnv(L"APPDATA") + LR"(\Microsoft\Windows\Start Menu\)" + sview_to_wstr(menu_rel_path) + L".lnk"; if (!std::filesystem::exists(path)) { - return SUCCEEDED(InstallShortcut(exePath, waumid, path)); + return SUCCEEDED(InstallShortcut(GetExePath(), waumid, path)); } else { @@ -150,7 +148,7 @@ static bool ImplEnsureAumiddedShortcutExists( extern "C" { - gboolean EnsureAumiddedShortcutExists(const gchar* aumid) noexcept + gboolean EnsureAumiddedShortcutExists(const gchar *const aumid) noexcept { return g_try_invoke( ImplEnsureAumiddedShortcutExists, R"(Programs\Dino)", aumid); diff --git a/plugins/windows-notification/api/src/win32.cpp b/plugins/windows-notification/api/src/win32.cpp index 8b8e411e..85982a09 100644 --- a/plugins/windows-notification/api/src/win32.cpp +++ b/plugins/windows-notification/api/src/win32.cpp @@ -41,7 +41,7 @@ std::wstring GetEnv(const wchar_t *const variable_name) static bool ImplSetProcessAumid(const std::string_view aumid) { - auto waumid = sview_to_wstr(aumid); + const auto waumid = sview_to_wstr(aumid); if (waumid.empty()) { return false; @@ -65,7 +65,7 @@ extern "C" return FALSE; } - gboolean SetProcessAumid(const gchar* aumid) noexcept + gboolean SetProcessAumid(const gchar *const aumid) noexcept { return g_try_invoke(ImplSetProcessAumid, aumid); }