summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-09-30 09:57:40 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2019-09-30 09:17:39 +0000
commit9c8400d961f765608feb94b18b614a6cb3fd57ec (patch)
treea5aa161ce4affd2bca3ca5e705159d26e7384f5c
parent24dd7be6dbc150131db62921e2b5b922e136b8aa (diff)
downloadqt-creator-9c8400d961f765608feb94b18b614a6cb3fd57ec.tar.gz
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 <eike.ziller@qt.io>
-rw-r--r--src/plugins/coreplugin/outputwindow.cpp5
1 files changed, 4 insertions, 1 deletions
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);