mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-11 12:45:05 +01:00
configure_hotkey: Make IsUsedKey() a const member function
This doesn't actually modify instance state of the dialog, so this can be made const.
This commit is contained in:
parent
46b015befd
commit
35281b4b3b
@ -35,7 +35,7 @@ void ConfigureHotkeys::EmitHotkeysChanged() {
|
|||||||
emit HotkeysChanged(GetUsedKeyList());
|
emit HotkeysChanged(GetUsedKeyList());
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QKeySequence> ConfigureHotkeys::GetUsedKeyList() {
|
QList<QKeySequence> ConfigureHotkeys::GetUsedKeyList() const {
|
||||||
QList<QKeySequence> list;
|
QList<QKeySequence> list;
|
||||||
for (int r = 0; r < model->rowCount(); r++) {
|
for (int r = 0; r < model->rowCount(); r++) {
|
||||||
QStandardItem* parent = model->item(r, 0);
|
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);
|
return input_keys_list.contains(key_sequence) || GetUsedKeyList().contains(key_sequence);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,8 +42,8 @@ signals:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void Configure(QModelIndex index);
|
void Configure(QModelIndex index);
|
||||||
bool IsUsedKey(QKeySequence key_sequence);
|
bool IsUsedKey(QKeySequence key_sequence) const;
|
||||||
QList<QKeySequence> GetUsedKeyList();
|
QList<QKeySequence> GetUsedKeyList() const;
|
||||||
|
|
||||||
std::unique_ptr<Ui::ConfigureHotkeys> ui;
|
std::unique_ptr<Ui::ConfigureHotkeys> ui;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user