fix regressions in SplashObserver::SendLog and ReportOutput::SendLog
This commit is contained in:
@@ -384,7 +384,7 @@ void ReportOutput::restoreFont()
|
||||
void ReportOutput::SendLog(const std::string& msg, Base::LogStyle level)
|
||||
{
|
||||
ReportHighlighter::Paragraph style = ReportHighlighter::LogText;
|
||||
switch(level){
|
||||
switch (level) {
|
||||
case Base::LogStyle::Warning:
|
||||
style = ReportHighlighter::Warning;
|
||||
break;
|
||||
@@ -398,12 +398,17 @@ void ReportOutput::SendLog(const std::string& msg, Base::LogStyle level)
|
||||
style = ReportHighlighter::LogText;
|
||||
break;
|
||||
}
|
||||
// This truncates messages that are too long
|
||||
|
||||
QString qMsg = QString::fromUtf8(msg.c_str());
|
||||
if(messageSize > 0 && qMsg.size()>messageSize) {
|
||||
qMsg.truncate(messageSize);
|
||||
qMsg += QString::fromLatin1("...\n");
|
||||
|
||||
// This truncates log messages that are too long
|
||||
if (style == ReportHighlighter::LogText) {
|
||||
if (messageSize > 0 && qMsg.size()>messageSize) {
|
||||
qMsg.truncate(messageSize);
|
||||
qMsg += QString::fromLatin1("...\n");
|
||||
}
|
||||
}
|
||||
|
||||
// Send the event to itself to allow thread-safety. Qt will delete it when done.
|
||||
CustomReportEvent* ev = new CustomReportEvent(style, qMsg);
|
||||
QApplication::postEvent(this, ev);
|
||||
|
||||
@@ -112,12 +112,13 @@ public:
|
||||
}
|
||||
void SendLog(const std::string& msg, Base::LogStyle level) override
|
||||
{
|
||||
(void) level; // to eliminate unused parameter warning
|
||||
|
||||
#ifdef FC_DEBUG
|
||||
Log(msg.c_str());
|
||||
Q_UNUSED(level)
|
||||
#else
|
||||
Q_UNUSED(msg.c_str());
|
||||
if (level == Base::LogStyle::Log) {
|
||||
Log(msg.c_str());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
void Log (const char * s)
|
||||
|
||||
Reference in New Issue
Block a user