From 0723deb2fc0eebbf460d35cc12e2f30a159b3350 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Wed, 10 Jun 2015 11:08:04 +0200 Subject: [PATCH] SearchToolbar: Remove "Highlight" option It is no longer available with QWebEngine. Also rewrite callback to use lambda instead of invoke wrapper. --- src/lib/webtab/searchtoolbar.cpp | 21 +++------------------ src/lib/webtab/searchtoolbar.ui | 10 ---------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/lib/webtab/searchtoolbar.cpp b/src/lib/webtab/searchtoolbar.cpp index 86cef875a..cb34fab28 100644 --- a/src/lib/webtab/searchtoolbar.cpp +++ b/src/lib/webtab/searchtoolbar.cpp @@ -24,22 +24,6 @@ #include #include -template -struct InvokeWrapper { - R* receiver; - void (C::*memberFun)(Arg); - void operator()(Arg result) { - (receiver->*memberFun)(result); - } -}; - -template -InvokeWrapper invoke(R* receiver, void (C::*memberFun)(Arg)) -{ - InvokeWrapper wrapper = {receiver, memberFun}; - return wrapper; -} - SearchToolBar::SearchToolBar(WebView* view, QWidget* parent) : AnimatedWidget(AnimatedWidget::Up, 300, parent) , ui(new Ui::SearchToolbar) @@ -133,7 +117,9 @@ void SearchToolBar::caseSensitivityChanged() void SearchToolBar::searchText(const QString &text) { - m_view->findText(text, m_findFlags, invoke(this, &SearchToolBar::handleSearchResult)); + m_view->findText(text, m_findFlags, [this](bool found) { + handleSearchResult(found); + }); } void SearchToolBar::handleSearchResult(bool found) @@ -149,7 +135,6 @@ void SearchToolBar::handleSearchResult(bool found) ui->results->clear(); } - ui->lineEdit->setProperty("notfound", QVariant(!found)); ui->lineEdit->style()->unpolish(ui->lineEdit); diff --git a/src/lib/webtab/searchtoolbar.ui b/src/lib/webtab/searchtoolbar.ui index cd324bbba..5cd036014 100644 --- a/src/lib/webtab/searchtoolbar.ui +++ b/src/lib/webtab/searchtoolbar.ui @@ -82,16 +82,6 @@ - - - - Highlight - - - true - - -