From 9c8400d961f765608feb94b18b614a6cb3fd57ec Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 30 Sep 2019 09:57:40 +0200 Subject: Output windows: Skip filter function if no filter is set Running the filter function is (too?) expensive, so make sure that's only done when there actually is a filter. Task-number: QTCREATORBUG-22914 Change-Id: Ie96a4e20ebb10c08d83e75641e70b42b13377b22 Reviewed-by: Eike Ziller --- src/plugins/coreplugin/outputwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/outputwindow.cpp b/src/plugins/coreplugin/outputwindow.cpp index 6c33b8dafe..f920ffc389 100644 --- a/src/plugins/coreplugin/outputwindow.cpp +++ b/src/plugins/coreplugin/outputwindow.cpp @@ -117,7 +117,10 @@ OutputWindow::OutputWindow(Context context, const QString &settingsKey, QWidget connect(copyAction, &QAction::triggered, this, &QPlainTextEdit::copy); connect(pasteAction, &QAction::triggered, this, &QPlainTextEdit::paste); connect(selectAllAction, &QAction::triggered, this, &QPlainTextEdit::selectAll); - connect(this, &QPlainTextEdit::blockCountChanged, this, &OutputWindow::filterNewContent); + connect(this, &QPlainTextEdit::blockCountChanged, this, [this] { + if (!d->filterText.isEmpty()) + filterNewContent(); + }); connect(this, &QPlainTextEdit::undoAvailable, undoAction, &QAction::setEnabled); connect(this, &QPlainTextEdit::redoAvailable, redoAction, &QAction::setEnabled); -- cgit v1.2.1