From 936015b34565ecc2cb34fbde1f33279c98783fd4 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 30 Oct 2023 08:11:11 +0100 Subject: [PATCH] Core: Don't create Log Viewer just to close it Change-Id: I92a724b0b1bc6a749fbd18f91494be0f2eff11d8 Reviewed-by: Christian Stenger --- src/plugins/coreplugin/loggingviewer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/plugins/coreplugin/loggingviewer.cpp b/src/plugins/coreplugin/loggingviewer.cpp index 1cb95ae8b7f..0ee6c0b7f42 100644 --- a/src/plugins/coreplugin/loggingviewer.cpp +++ b/src/plugins/coreplugin/loggingviewer.cpp @@ -1100,6 +1100,8 @@ void setCategoryColor(const QString &category, const QColor &color) s_categoryColor.remove(category); } +static bool wasLogViewerShown = false; + void LoggingViewer::showLoggingView() { LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance(); @@ -1108,10 +1110,15 @@ void LoggingViewer::showLoggingView() staticLogWidget->show(); staticLogWidget->raise(); staticLogWidget->activateWindow(); + + wasLogViewerShown = true; } void LoggingViewer::hideLoggingView() { + if (!wasLogViewerShown) + return; + LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance(); QTC_ASSERT(staticLogWidget, return); staticLogWidget->close();