2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

yuzu/about_dialog: Specify string conversions explicitly

Specifies the conversions explicitly to avoid implicit conversions from
const char* to QString. This makes it easier to disable implicit QString
conversions in the future.

In this case, the implicit conversion was technically wrong as well. The
implicit conversion treats the input strings as ASCII characters. This
would result in an incorrect conversion being performed in the rare case
a branch name was created with a non-ASCII Unicode character, likely
resulting in junk being displayed.
This commit is contained in:
Lioncash 2019-05-09 01:18:28 -04:00
parent 75a8b304d4
commit bf1829a717

View file

@ -9,10 +9,10 @@
AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) {
ui->setupUi(this); ui->setupUi(this);
ui->labelLogo->setPixmap(QIcon::fromTheme("yuzu").pixmap(200)); ui->labelLogo->setPixmap(QIcon::fromTheme(QStringLiteral("yuzu")).pixmap(200));
ui->labelBuildInfo->setText( ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg(
ui->labelBuildInfo->text().arg(Common::g_build_fullname, Common::g_scm_branch, QString::fromUtf8(Common::g_build_fullname), QString::fromUtf8(Common::g_scm_branch),
Common::g_scm_desc, QString(Common::g_build_date).left(10))); QString::fromUtf8(Common::g_scm_desc), QString::fromUtf8(Common::g_build_date).left(10)));
} }
AboutDialog::~AboutDialog() = default; AboutDialog::~AboutDialog() = default;