Gui: implement temporary blocker for console observer

This commit is contained in:
0penBrain
2022-06-20 16:09:08 +02:00
committed by wwmayer
parent 06d65c73a3
commit 95a98669a4
3 changed files with 51 additions and 12 deletions

View File

@@ -42,6 +42,7 @@
#include <App/Application.h>
#include <Base/Console.h>
#include <Base/ConsoleObserver.h>
#include "BitmapFactory.h"
@@ -337,11 +338,12 @@ QPixmap BitmapFactoryInst::pixmapFromSvg(const QByteArray& originalContents, con
image.fill(0x00000000);
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, tmp);
QSvgRenderer svg;
{
// tmp. disable the report window to suppress some bothering warnings
const Base::ILoggerBlocker blocker("ReportOutput", Base::ConsoleSingleton::MsgType_Wrn);
svg.load(contents);
}
svg.render(&p);
p.end();