From e4ffd8374040d36c22125eeb534d884f56978592 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Tue, 17 Apr 2018 17:43:38 +0200 Subject: Style pass --- src/addressbar/addressbar.cpp | 9 +++++---- src/addressbar/addressbar.h | 2 +- src/addressbar/urllineedit.h | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/addressbar') diff --git a/src/addressbar/addressbar.cpp b/src/addressbar/addressbar.cpp index 1c10d69..b86230c 100644 --- a/src/addressbar/addressbar.cpp +++ b/src/addressbar/addressbar.cpp @@ -10,8 +10,8 @@ #include "urllineedit.h" #include "webengine/webview.h" #include -#include #include +#include AddressBar::AddressBar(const QHash &config, QWidget *parent) : QWidget(parent) @@ -36,7 +36,7 @@ AddressBar::AddressBar(const QHash &config, QWidget *parent) urlBar->toolsMenu_action->setToolTip(tr("Tools (%1)").arg(urlBar->toolsMenu_action->shortcut().toString())); connect(urlBar, &UrlLineEdit::textEdited, [=](const QString &text) { - std::function callback = std::bind(&UrlLineEdit::updateCompleter, urlBar, std::placeholders::_1); + std::function callback = std::bind(&UrlLineEdit::updateCompleter, urlBar, std::placeholders::_1); emit complete(text, callback); }); @@ -53,7 +53,7 @@ AddressBar::~AddressBar() disconnect(progressBarConnection); } -void AddressBar::connectWebView(WebView* view) +void AddressBar::connectWebView(WebView *view) { disconnect(urlChangedConnection); disconnect(loadUrlConnection); @@ -73,7 +73,8 @@ void AddressBar::connectWebView(WebView* view) urlBar->toolsMenu_action->setMenu(view->toolsMenu()); urlChangedConnection = connect(view, &WebView::urlChanged, urlBar, &UrlLineEdit::setUrl); loadUrlConnection = connect(urlBar, &UrlLineEdit::returnPressed, [=]() { - if(urlBar->text().startsWith('#')) {; + if(urlBar->text().startsWith('#')) { + ; view->search(urlBar->text().mid(1)); } else { view->load(QUrl::fromUserInput(urlBar->text())); diff --git a/src/addressbar/addressbar.h b/src/addressbar/addressbar.h index 224fb9b..9b8b360 100644 --- a/src/addressbar/addressbar.h +++ b/src/addressbar/addressbar.h @@ -24,7 +24,7 @@ public: ~AddressBar() override; signals: - void complete(const QString &term, std::function callback); + void complete(const QString &term, std::function callback); public slots: void connectWebView(WebView *view); diff --git a/src/addressbar/urllineedit.h b/src/addressbar/urllineedit.h index bc23f58..f27addc 100644 --- a/src/addressbar/urllineedit.h +++ b/src/addressbar/urllineedit.h @@ -33,7 +33,6 @@ public: // devMenu action: scripts, etc QAction *toolsMenu_action = nullptr; - protected: void focusInEvent(QFocusEvent *event) override; void focusOutEvent(QFocusEvent *event) override; -- cgit v1.2.1