1
0
mirror of synced 2025-02-17 18:59:21 +01:00

impr: Don't pass unique_ptr by const reference

This commit is contained in:
WerWolv 2024-02-24 15:06:28 +01:00
parent b2edb0441a
commit 393bea6d4b
3 changed files with 3 additions and 3 deletions

View File

@ -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<View> &currentView, 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.

View File

@ -57,7 +57,7 @@ namespace hex {
}
}
void ShortcutManager::process(const std::unique_ptr<View> &currentView, 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());

View File

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