From 45cfbbeb6b1b1e7c95a30ad7d21df69c6dce3e92 Mon Sep 17 00:00:00 2001 From: Collecting Date: Sat, 1 Nov 2025 21:02:21 +0000 Subject: [PATCH] fix/hotkeys Signed-off-by: Collecting --- src/citron/hotkeys.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/citron/hotkeys.h b/src/citron/hotkeys.h index bdc081649..da699225d 100644 --- a/src/citron/hotkeys.h +++ b/src/citron/hotkeys.h @@ -1,4 +1,5 @@ // SPDX-FileCopyrightText: 2014 Citra Emulator Project +// SPDX-FileCopyrightText: 2025 citron Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later #pragma once @@ -88,9 +89,9 @@ public: * will be the same. Thus, you shouldn't rely on the caller really being the * QShortcut's parent. */ - QShortcut* GetHotkey(const std::string& group, const std::string& action, QWidget* widget); + QShortcut* GetHotkey(const std::string& group, const std::string& action, QWidget* widget) const; ControllerShortcut* GetControllerHotkey(const std::string& group, const std::string& action, - Core::HID::EmulatedController* controller); + Core::HID::EmulatedController* controller) const; /** * Returns a QKeySequence object whose signal can be connected to QAction::setShortcut. @@ -98,7 +99,7 @@ public: * @param group General group this hotkey belongs to (e.g. "Main Window", "Debugger"). * @param action Name of the action (e.g. "Start Emulation", "Load Image"). */ - QKeySequence GetKeySequence(const std::string& group, const std::string& action); + QKeySequence GetKeySequence(const std::string& group, const std::string& action) const; /** * Returns a Qt::ShortcutContext object who can be connected to other @@ -108,7 +109,7 @@ public: * "Debugger"). * @param action Name of the action (e.g. "Start Emulation", "Load Image"). */ - Qt::ShortcutContext GetShortcutContext(const std::string& group, const std::string& action); + Qt::ShortcutContext GetShortcutContext(const std::string& group, const std::string& action) const; private: struct Hotkey { @@ -123,5 +124,5 @@ private: using HotkeyMap = std::map; using HotkeyGroupMap = std::map; - HotkeyGroupMap hotkey_groups; + mutable HotkeyGroupMap hotkey_groups; };