diff options
author | aqua <aqua@iserlohn-fortress.net> | 2022-09-08 17:40:11 +0300 |
---|---|---|
committer | aqua <aqua@iserlohn-fortress.net> | 2022-09-08 17:56:44 +0300 |
commit | 749ee367a41a484bc80acf47cc4cca1af2a6c544 (patch) | |
tree | 0b6cfb3e84c31a6060a59b974406c5fb9c6adfa1 /src/rekonqwindow_class.cpp | |
parent | RekonqSettings: add resetValue and remove value's defaultValue parameter (diff) | |
download | rekonq-749ee367a41a484bc80acf47cc4cca1af2a6c544.tar.xz |
RekonqWindow: apply shortcuts
Diffstat (limited to 'src/rekonqwindow_class.cpp')
-rw-r--r-- | src/rekonqwindow_class.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/rekonqwindow_class.cpp b/src/rekonqwindow_class.cpp index d0645cb6..037abf9a 100644 --- a/src/rekonqwindow_class.cpp +++ b/src/rekonqwindow_class.cpp @@ -10,12 +10,14 @@ #include "rekonqwindow.hpp" #include "ui_rekonqwindow.h" #include <QRegularExpression> +#include <qglobal.h> #include <rview.hpp> #ifndef REKONQ_TEST #include "application.hpp" #include "settings/settingsdialog.h" #include "taskmanager.h" +#include <spdlog/spdlog.h> #endif #if defined(QT_DEBUG) && !defined(REKONQ_TEST) @@ -82,10 +84,19 @@ RekonqWindow::RekonqWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::Re RekonqWindow::~RekonqWindow() { delete ui; } -void RekonqWindow::setupShortcuts(const RekonqSettings *settings) +void RekonqWindow::setupShortcuts(RekonqSettings *settings) { + settings->beginGroup("Shortcuts"); + for (auto *action : findChildren<QAction *>(QRegularExpression("^action.*"))) { const auto shortcut = settings->value(action->objectName()); - if (shortcut.isValid()) action->setShortcut(shortcut.toString()); + if (!shortcut.isNull()) { + action->setShortcut(shortcut.toString()); +#ifndef REKONQ_TEST + spdlog::debug("Set shortcut {} -> {}", qUtf8Printable(shortcut.toString()), qUtf8Printable(action->objectName())); +#endif + } } + + settings->endGroup(); } |