소스 검색

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.
Lioncash 7 년 전
부모
커밋
bf1829a717
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      src/yuzu/about_dialog.cpp

+ 4 - 4
src/yuzu/about_dialog.cpp

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