From 35281b4b3bdfd1568e40f6142d8d26aaa7af51ed Mon Sep 17 00:00:00 2001 From: Lioncash <mathew1800@gmail.com> Date: Tue, 9 Apr 2019 19:35:52 -0400 Subject: [PATCH] configure_hotkey: Make IsUsedKey() a const member function This doesn't actually modify instance state of the dialog, so this can be made const. --- src/citra_qt/configuration/configure_hotkeys.cpp | 4 ++-- src/citra_qt/configuration/configure_hotkeys.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/citra_qt/configuration/configure_hotkeys.cpp b/src/citra_qt/configuration/configure_hotkeys.cpp index aae212b5da..d8cfe52efd 100644 --- a/src/citra_qt/configuration/configure_hotkeys.cpp +++ b/src/citra_qt/configuration/configure_hotkeys.cpp @@ -35,7 +35,7 @@ void ConfigureHotkeys::EmitHotkeysChanged() { emit HotkeysChanged(GetUsedKeyList()); } -QList<QKeySequence> ConfigureHotkeys::GetUsedKeyList() { +QList<QKeySequence> ConfigureHotkeys::GetUsedKeyList() const { QList<QKeySequence> list; for (int r = 0; r < model->rowCount(); r++) { QStandardItem* parent = model->item(r, 0); @@ -94,7 +94,7 @@ void ConfigureHotkeys::Configure(QModelIndex index) { } } -bool ConfigureHotkeys::IsUsedKey(QKeySequence key_sequence) { +bool ConfigureHotkeys::IsUsedKey(QKeySequence key_sequence) const { return input_keys_list.contains(key_sequence) || GetUsedKeyList().contains(key_sequence); } diff --git a/src/citra_qt/configuration/configure_hotkeys.h b/src/citra_qt/configuration/configure_hotkeys.h index bd2c1542ca..6fc34207e7 100644 --- a/src/citra_qt/configuration/configure_hotkeys.h +++ b/src/citra_qt/configuration/configure_hotkeys.h @@ -42,8 +42,8 @@ signals: private: void Configure(QModelIndex index); - bool IsUsedKey(QKeySequence key_sequence); - QList<QKeySequence> GetUsedKeyList(); + bool IsUsedKey(QKeySequence key_sequence) const; + QList<QKeySequence> GetUsedKeyList() const; std::unique_ptr<Ui::ConfigureHotkeys> ui;