Gui: implement temporary blocker for console observer
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user