diff options
Diffstat (limited to 'src/mainwindow/subwindow.cpp')
-rw-r--r-- | src/mainwindow/subwindow.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mainwindow/subwindow.cpp b/src/mainwindow/subwindow.cpp index 5a1eeda..342fce8 100644 --- a/src/mainwindow/subwindow.cpp +++ b/src/mainwindow/subwindow.cpp @@ -20,8 +20,9 @@ #include <QToolButton> #include <webprofile.h> #include "profilemanager.h" +#include <configuration.h> -SubWindow::SubWindow(const QHash<QString, QString> &config, QWidget *parent, Qt::WindowFlags flags) +SubWindow::SubWindow(const std::unique_ptr<Configuration> &config, QWidget *parent, Qt::WindowFlags flags) : QMdiSubWindow(parent, flags) , tabWidget(new TabWidget(this)) { @@ -62,7 +63,7 @@ SubWindow::SubWindow(const QHash<QString, QString> &config, QWidget *parent, Qt: auto *newTab_button = new QToolButton(this); newTab_button->setIcon(style()->standardIcon(QStyle::SP_FileIcon)); newTab_button->setToolTip(tr("Add tab")); - newTab_button->setShortcut(QKeySequence(config.value("window.shortcuts.new"))); + newTab_button->setShortcut(QKeySequence(config->value<QString>("window.shortcuts.new").value())); connect(newTab_button, &QToolButton::clicked, this, [=]() { auto index = addTab(WebProfile::defaultProfile()->newtab()); tabWidget->setCurrentIndex(index); @@ -70,17 +71,17 @@ SubWindow::SubWindow(const QHash<QString, QString> &config, QWidget *parent, Qt: tabWidget->setCornerWidget(newTab_button, Qt::TopRightCorner); // general actions - auto *closeTab_shortcut = new QShortcut(QKeySequence(config.value("window.shortcuts.close")), this); + auto *closeTab_shortcut = new QShortcut(QKeySequence(config->value<QString>("window.shortcuts.close").value()), this); connect(closeTab_shortcut, &QShortcut::activated, this, [=]() { tabWidget->deleteTab(tabWidget->currentIndex()); }); - auto *leftTab_shortcut = new QShortcut(QKeySequence(config.value("window.shortcuts.left")), this); + auto *leftTab_shortcut = new QShortcut(QKeySequence(config->value<QString>("window.shortcuts.left").value()), this); connect(leftTab_shortcut, &QShortcut::activated, this, [=]() { tabWidget->setCurrentIndex(qMax(0, tabWidget->currentIndex() - 1)); }); - auto *rightTab_shortcut = new QShortcut(QKeySequence(config.value("window.shortcuts.right")), this); + auto *rightTab_shortcut = new QShortcut(QKeySequence(config->value<QString>("window.shortcuts.right").value()), this); connect(rightTab_shortcut, &QShortcut::activated, this, [=]() { tabWidget->setCurrentIndex(qMin(tabWidget->currentIndex() + 1, tabWidget->count() - 1)); }); |