1
0
Fork 0

Launcher: tweak how Qt Fatal log messages are handled

This commit is contained in:
James Turner 2021-04-04 16:34:46 +01:00
parent dd475e1934
commit 019d6cc53a

View file

@ -333,7 +333,10 @@ static void simgearMessageOutput(QtMsgType type, const QMessageLogContext &conte
// important we copy the file name here, since QMessageLogContext doesn't // important we copy the file name here, since QMessageLogContext doesn't
sglog().logCopyingFilename(SG_GUI, mappedPriority, file, context.line, "" /*function*/, s); sglog().logCopyingFilename(SG_GUI, mappedPriority, file, context.line, "" /*function*/, s);
if (type == QtFatalMsg) { if (type == QtFatalMsg) {
abort(); // if we abort() here, we get a thread crash which prevents
// us actually seeing the error
// we'll attempt to continue so we do the SG_POPUP dialog, maybe it works
// if it crashes we're no worse off than calling abort() here
} }
} }
@ -355,7 +358,7 @@ static std::unique_ptr<QApplication> static_qApp;
void selectUITranslation() void selectUITranslation()
{ {
QStringList uiLanguages = QLocale::system().uiLanguages(); QStringList uiLanguages = QLocale::system().uiLanguages();
qWarning() << "UI languages:" << uiLanguages; //qWarning() << "UI languages:" << uiLanguages;
for (QString locale : qAsConst(uiLanguages)) { for (QString locale : qAsConst(uiLanguages)) {
// remove script if it exists, eg zh-Hans-CN -> zh-CN // remove script if it exists, eg zh-Hans-CN -> zh-CN