From 393bea6d4b24918bd910019330332d2995944e6c Mon Sep 17 00:00:00 2001 From: WerWolv Date: Sat, 24 Feb 2024 15:06:28 +0100 Subject: [PATCH] impr: Don't pass unique_ptr by const reference --- lib/libimhex/include/hex/api/shortcut_manager.hpp | 2 +- lib/libimhex/source/api/shortcut_manager.cpp | 2 +- main/gui/source/window/window.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/libimhex/include/hex/api/shortcut_manager.hpp b/lib/libimhex/include/hex/api/shortcut_manager.hpp index ed0feafa1..dc49b46a1 100644 --- a/lib/libimhex/include/hex/api/shortcut_manager.hpp +++ b/lib/libimhex/include/hex/api/shortcut_manager.hpp @@ -425,7 +425,7 @@ namespace hex { * @param focused Whether the current view is focused * @param keyCode The key code of the key that was pressed */ - static void process(const std::unique_ptr ¤tView, bool ctrl, bool alt, bool shift, bool super, bool focused, u32 keyCode); + static void process(const View *currentView, bool ctrl, bool alt, bool shift, bool super, bool focused, u32 keyCode); /** * @brief Process a key event. This should be called from the main loop. diff --git a/lib/libimhex/source/api/shortcut_manager.cpp b/lib/libimhex/source/api/shortcut_manager.cpp index d92172112..4663bf3b4 100644 --- a/lib/libimhex/source/api/shortcut_manager.cpp +++ b/lib/libimhex/source/api/shortcut_manager.cpp @@ -57,7 +57,7 @@ namespace hex { } } - void ShortcutManager::process(const std::unique_ptr ¤tView, bool ctrl, bool alt, bool shift, bool super, bool focused, u32 keyCode) { + void ShortcutManager::process(const View *currentView, bool ctrl, bool alt, bool shift, bool super, bool focused, u32 keyCode) { const Shortcut pressedShortcut = getShortcut(ctrl, alt, shift, super, focused, keyCode); if (keyCode != 0) s_prevShortcut = Shortcut(pressedShortcut.getKeys()); diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp index 602064931..0d6e22d22 100644 --- a/main/gui/source/window/window.cpp +++ b/main/gui/source/window/window.cpp @@ -539,7 +539,7 @@ namespace hex { // Pass on currently pressed keys to the shortcut handler for (const auto &key : m_pressedKeys) { - ShortcutManager::process(view, io.KeyCtrl, io.KeyAlt, io.KeyShift, io.KeySuper, focused, key); + ShortcutManager::process(view.get(), io.KeyCtrl, io.KeyAlt, io.KeyShift, io.KeySuper, focused, key); } } }