Add information about unnamed/main threads in logs and fatal dialog

* If thread is unnamed, keep log name empty for main thread, otherwise print thread id. In fatal dialog, main thread can be handled differently (with special remark that it's main thread).
* Always print thread id in fatal dialog, regardless of thread type.

Co-authored-by: Nekotekina <nekotekina@gmail.com>
This commit is contained in:
Eladash 2021-03-01 13:58:13 +02:00 committed by Ivan
parent 40f3adc45f
commit cd6ef2958b
6 changed files with 55 additions and 34 deletions

View file

@ -3,9 +3,7 @@
#include <QLayout>
#include <QTextDocument>
#include <string>
fatal_error_dialog::fatal_error_dialog(const std::string& text) : QMessageBox()
fatal_error_dialog::fatal_error_dialog(std::string_view text) : QMessageBox()
{
setWindowTitle(tr("RPCS3: Fatal Error"));
setIcon(QMessageBox::Icon::Critical);
@ -18,7 +16,7 @@ fatal_error_dialog::fatal_error_dialog(const std::string& text) : QMessageBox()
%3<br>
</p>
)")
.arg(Qt::convertFromPlainText(QString::fromStdString(text)))
.arg(Qt::convertFromPlainText(QString::fromUtf8(text.data(), text.size())))
.arg(tr("HOW TO REPORT ERRORS:"))
.arg(tr("Please, don't send incorrect reports. Thanks for understanding.")));
layout()->setSizeConstraint(QLayout::SetFixedSize);