From 3fe4e4b6a681f64cb4731195bc670f872146600c Mon Sep 17 00:00:00 2001 From: 0penBrain <48731257+0penBrain@users.noreply.github.com> Date: Wed, 15 Jun 2022 12:13:40 +0200 Subject: [PATCH] [BUGFIX] Gui: correctly save and restore warning type enabling in report view --- src/Gui/BitmapFactory.cpp | 3 ++- src/Gui/MainWindow.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Gui/BitmapFactory.cpp b/src/Gui/BitmapFactory.cpp index bfc0f9e2d2..eeb436a237 100644 --- a/src/Gui/BitmapFactory.cpp +++ b/src/Gui/BitmapFactory.cpp @@ -338,9 +338,10 @@ QPixmap BitmapFactoryInst::pixmapFromSvg(const QByteArray& originalContents, con QPainter p(&image); // tmp. disable the report window to suppress some bothering warnings + auto tmp = Base::Console().IsMsgTypeEnabled("ReportOutput", Base::ConsoleSingleton::MsgType_Wrn); Base::Console().SetEnabledMsgType("ReportOutput", Base::ConsoleSingleton::MsgType_Wrn, false); QSvgRenderer svg(contents); - Base::Console().SetEnabledMsgType("ReportOutput", Base::ConsoleSingleton::MsgType_Wrn, true); + Base::Console().SetEnabledMsgType("ReportOutput", Base::ConsoleSingleton::MsgType_Wrn, tmp); svg.render(&p); p.end(); diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp index 37617d4b3c..e96afb9319 100644 --- a/src/Gui/MainWindow.cpp +++ b/src/Gui/MainWindow.cpp @@ -1414,10 +1414,11 @@ void MainWindow::loadWindowSettings() this->move(pos); // tmp. disable the report window to suppress some bothering warnings + auto tmp = Base::Console().IsMsgTypeEnabled("ReportOutput", Base::ConsoleSingleton::MsgType_Wrn); Base::Console().SetEnabledMsgType("ReportOutput", Base::ConsoleSingleton::MsgType_Wrn, false); this->restoreState(config.value(QString::fromLatin1("MainWindowState")).toByteArray()); std::clog << "Main window restored" << std::endl; - Base::Console().SetEnabledMsgType("ReportOutput", Base::ConsoleSingleton::MsgType_Wrn, true); + Base::Console().SetEnabledMsgType("ReportOutput", Base::ConsoleSingleton::MsgType_Wrn, tmp); bool max = config.value(QString::fromLatin1("Maximized"), false).toBool(); max ? showMaximized() : show();