diff options
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(); } |