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); }