From 61de50069b2fb25afef665dd9a5c1eeb2976a26b Mon Sep 17 00:00:00 2001 From: Rayyan Ansari Date: Fri, 2 Sep 2022 11:54:47 +0100 Subject: [PATCH] Fix handling of utf16 title strings in ROMInfoDialog Title strings should be null-terminated. Read the string up until this point instead of reading the full 128 characters. (Also fix the .ui file of ROMInfoDialog to prevent it from being too wide.) --- src/frontend/qt_sdl/ROMInfoDialog.cpp | 12 ++--- src/frontend/qt_sdl/ROMInfoDialog.ui | 65 +++++---------------------- 2 files changed, 17 insertions(+), 60 deletions(-) diff --git a/src/frontend/qt_sdl/ROMInfoDialog.cpp b/src/frontend/qt_sdl/ROMInfoDialog.cpp index 0a71dc8b..e82ec4be 100644 --- a/src/frontend/qt_sdl/ROMInfoDialog.cpp +++ b/src/frontend/qt_sdl/ROMInfoDialog.cpp @@ -75,12 +75,12 @@ ROMInfoDialog::ROMInfoDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ROMI ui->iconTitle->setText(QString::fromUtf16(NDSCart::Banner.EnglishTitle)); - ui->japaneseTitle->setText(QString::fromUtf16(NDSCart::Banner.JapaneseTitle, 128)); - ui->englishTitle->setText(QString::fromUtf16(NDSCart::Banner.EnglishTitle, 128)); - ui->frenchTitle->setText(QString::fromUtf16(NDSCart::Banner.FrenchTitle, 128)); - ui->germanTitle->setText(QString::fromUtf16(NDSCart::Banner.GermanTitle, 128)); - ui->italianTitle->setText(QString::fromUtf16(NDSCart::Banner.ItalianTitle, 128)); - ui->spanishTitle->setText(QString::fromUtf16(NDSCart::Banner.SpanishTitle, 128)); + ui->japaneseTitle->setText(QString::fromUtf16(NDSCart::Banner.JapaneseTitle)); + ui->englishTitle->setText(QString::fromUtf16(NDSCart::Banner.EnglishTitle)); + ui->frenchTitle->setText(QString::fromUtf16(NDSCart::Banner.FrenchTitle)); + ui->germanTitle->setText(QString::fromUtf16(NDSCart::Banner.GermanTitle)); + ui->italianTitle->setText(QString::fromUtf16(NDSCart::Banner.ItalianTitle)); + ui->spanishTitle->setText(QString::fromUtf16(NDSCart::Banner.SpanishTitle)); if (NDSCart::Banner.Version > 1) ui->chineseTitle->setText(QString::fromUtf16(NDSCart::Banner.ChineseTitle)); diff --git a/src/frontend/qt_sdl/ROMInfoDialog.ui b/src/frontend/qt_sdl/ROMInfoDialog.ui index 0c65cab3..1c9d844b 100644 --- a/src/frontend/qt_sdl/ROMInfoDialog.ui +++ b/src/frontend/qt_sdl/ROMInfoDialog.ui @@ -6,8 +6,8 @@ 0 0 - 427 - 434 + 559 + 532 @@ -22,12 +22,6 @@ - - - 0 - 0 - - Titles @@ -350,12 +344,6 @@ - - - 0 - 0 - - Filesystem @@ -441,12 +429,6 @@ - - - 0 - 0 - - General info @@ -668,7 +650,7 @@ - + @@ -742,43 +724,11 @@ - - - - Qt::Horizontal - - - - 55 - 20 - - - - - + Qt::Horizontal - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - @@ -788,6 +738,13 @@ + + + + Qt::Horizontal + + +