diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-17 17:43:38 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2018-04-17 17:43:38 +0200 |
commit | e4ffd8374040d36c22125eeb534d884f56978592 (patch) | |
tree | 1917ed64bf8e6e391ebf46de79a6fea41e0dcf68 /src/addressbar | |
parent | Hovering over links shows them in the status bar again (diff) | |
download | smolbote-e4ffd8374040d36c22125eeb534d884f56978592.tar.xz |
Style pass
Diffstat (limited to 'src/addressbar')
-rw-r--r-- | src/addressbar/addressbar.cpp | 9 | ||||
-rw-r--r-- | src/addressbar/addressbar.h | 2 | ||||
-rw-r--r-- | src/addressbar/urllineedit.h | 1 |
3 files changed, 6 insertions, 6 deletions
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 <QProgressBar> -#include <QVBoxLayout> #include <QShortcut> +#include <QVBoxLayout> AddressBar::AddressBar(const QHash<QString, QString> &config, QWidget *parent) : QWidget(parent) @@ -36,7 +36,7 @@ AddressBar::AddressBar(const QHash<QString, QString> &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<void(QStringList&)> callback = std::bind(&UrlLineEdit::updateCompleter, urlBar, std::placeholders::_1); + std::function<void(QStringList &)> 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<void(QStringList&)> callback); + void complete(const QString &term, std::function<void(QStringList &)> 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; |