forked from qt-creator/qt-creator
Core: Don't create Log Viewer just to close it
Change-Id: I92a724b0b1bc6a749fbd18f91494be0f2eff11d8 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1100,6 +1100,8 @@ void setCategoryColor(const QString &category, const QColor &color)
|
|||||||
s_categoryColor.remove(category);
|
s_categoryColor.remove(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool wasLogViewerShown = false;
|
||||||
|
|
||||||
void LoggingViewer::showLoggingView()
|
void LoggingViewer::showLoggingView()
|
||||||
{
|
{
|
||||||
LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance();
|
LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance();
|
||||||
@@ -1108,10 +1110,15 @@ void LoggingViewer::showLoggingView()
|
|||||||
staticLogWidget->show();
|
staticLogWidget->show();
|
||||||
staticLogWidget->raise();
|
staticLogWidget->raise();
|
||||||
staticLogWidget->activateWindow();
|
staticLogWidget->activateWindow();
|
||||||
|
|
||||||
|
wasLogViewerShown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoggingViewer::hideLoggingView()
|
void LoggingViewer::hideLoggingView()
|
||||||
{
|
{
|
||||||
|
if (!wasLogViewerShown)
|
||||||
|
return;
|
||||||
|
|
||||||
LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance();
|
LoggingViewManagerWidget *staticLogWidget = LoggingViewManagerWidget::instance();
|
||||||
QTC_ASSERT(staticLogWidget, return);
|
QTC_ASSERT(staticLogWidget, return);
|
||||||
staticLogWidget->close();
|
staticLogWidget->close();
|
||||||
|
|||||||
Reference in New Issue
Block a user