More const detach fixes

This commit is contained in:
Jonas Kvinge
2024-08-23 20:30:59 +02:00
parent be09011bb7
commit 7ebcc73a49
54 changed files with 195 additions and 180 deletions

View File

@@ -278,17 +278,19 @@ void GlobalShortcutsSettingsPage::OpenMateKeybindingProperties() {
void GlobalShortcutsSettingsPage::SetShortcut(const QString &id, const QKeySequence &key) {
Shortcut &shortcut = shortcuts_[id];
Shortcut shortcut = shortcuts_.value(id);
shortcut.key = key;
shortcut.item->setText(1, key.toString(QKeySequence::NativeText));
shortcuts_[id] = shortcut;
}
void GlobalShortcutsSettingsPage::ItemClicked(QTreeWidgetItem *item) {
current_id_ = item->data(0, Qt::UserRole).toString();
Shortcut &shortcut = shortcuts_[current_id_];
const Shortcut shortcut = shortcuts_.value(current_id_);
// Enable options
ui_->shortcut_options->setEnabled(true);
@@ -324,7 +326,7 @@ void GlobalShortcutsSettingsPage::ChangeClicked() {
GlobalShortcutsManager *manager = dialog()->global_shortcuts_manager();
manager->Unregister();
QKeySequence key = grabber_->GetKey(shortcuts_[current_id_].s.action->text());
QKeySequence key = grabber_->GetKey(shortcuts_.value(current_id_).s.action->text());
manager->Register();
if (key.isEmpty()) return;