diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2019-09-30 09:57:40 +0200 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2019-09-30 09:17:39 +0000 |
commit | 9c8400d961f765608feb94b18b614a6cb3fd57ec (patch) | |
tree | a5aa161ce4affd2bca3ca5e705159d26e7384f5c /src/plugins/coreplugin/outputwindow.cpp | |
parent | 24dd7be6dbc150131db62921e2b5b922e136b8aa (diff) | |
download | qt-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>
Diffstat (limited to 'src/plugins/coreplugin/outputwindow.cpp')
-rw-r--r-- | src/plugins/coreplugin/outputwindow.cpp | 5 |
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); |