1
mirror of https://invent.kde.org/network/falkon.git synced 2024-09-21 17:52:10 +02:00

SearchToolbar: Remove "Highlight" option

It is no longer available with QWebEngine.
Also rewrite callback to use lambda instead of invoke wrapper.
This commit is contained in:
David Rosca 2015-06-10 11:08:04 +02:00
parent 406f522c61
commit 0723deb2fc
2 changed files with 3 additions and 28 deletions

View File

@ -24,22 +24,6 @@
#include <QKeyEvent>
#include <QShortcut>
template<typename Arg, typename R, typename C>
struct InvokeWrapper {
R* receiver;
void (C::*memberFun)(Arg);
void operator()(Arg result) {
(receiver->*memberFun)(result);
}
};
template<typename Arg, typename R, typename C>
InvokeWrapper<Arg, R, C> invoke(R* receiver, void (C::*memberFun)(Arg))
{
InvokeWrapper<Arg, R, C> 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);

View File

@ -82,16 +82,6 @@
</property>
</widget>
</item>
<item>
<widget class="MacToolButton" name="highligh">
<property name="text">
<string>Highlight</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="MacToolButton" name="caseSensitive">
<property name="text">