From 21552196c529cdc4e7112d2f09a80ab81c71207a Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Fri, 24 Feb 2017 02:06:20 +0100 Subject: Settings class rework Using toml as format --- src/widgets/webviewtabbar.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/webviewtabbar.cpp b/src/widgets/webviewtabbar.cpp index db44bc9..745a7a5 100644 --- a/src/widgets/webviewtabbar.cpp +++ b/src/widgets/webviewtabbar.cpp @@ -19,7 +19,7 @@ ******************************************************************************/ #include "webviewtabbar.h" -#include "settings.h" +#include "browser.h" #include WebViewTabBar::WebViewTabBar(QWidget *parent) : @@ -32,26 +32,25 @@ WebViewTabBar::WebViewTabBar(QWidget *parent) : connect(this, SIGNAL(currentChanged(int)), this, SLOT(handleCurrentChanged(int))); connect(this, SIGNAL(tabMoved(int,int)), this, SLOT(updateVectorArrangement(int,int))); - Settings settings; - if(settings.contains("shortcuts/tabClose")) { + if(sSettings->contains("shortcuts.tabClose")) { QAction *tabCloseAction = new QAction(this); - tabCloseAction->setShortcut(QKeySequence::fromString(settings.value("shortcuts/tabClose").toString())); + tabCloseAction->setShortcut(QKeySequence::fromString(sSettings->value("shortcuts.tabClose").toString())); connect(tabCloseAction, &QAction::triggered, [this]() { this->handleTabClose(currentIndex()); }); addAction(tabCloseAction); } - if(settings.contains("shortcuts/tabLeft")) { + if(sSettings->contains("shortcuts.tabLeft")) { QAction *tabLeftAction = new QAction(this); - tabLeftAction->setShortcut(QKeySequence::fromString(settings.value("shortcuts/tabLeft").toString())); + tabLeftAction->setShortcut(QKeySequence::fromString(sSettings->value("shortcuts.tabLeft").toString())); connect(tabLeftAction, &QAction::triggered, [this]() { this->setCurrentIndex(currentIndex()-1); }); addAction(tabLeftAction); } - if(settings.contains("shortcuts/tabRight")) { + if(sSettings->contains("shortcuts.tabRight")) { QAction *tabRightAction = new QAction(this); - tabRightAction->setShortcut(QKeySequence::fromString(settings.value("shortcuts/tabRight").toString())); + tabRightAction->setShortcut(QKeySequence::fromString(sSettings->value("shortcuts.tabRight").toString())); connect(tabRightAction, &QAction::triggered, [this]() { this->setCurrentIndex(currentIndex()+1); }); -- cgit v1.2.1