diff options
author | Chris Xiong <chirs241097@gmail.com> | 2023-11-26 21:29:16 -0500 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2023-11-26 21:29:16 -0500 |
commit | f7def0d883fa5cab62ef61b40b9f857245be8e6c (patch) | |
tree | d29322dd4be6e98c0740ae6df4dc70eb41614a76 /qmidiplayer-desktop/qmpinfowindow.cpp | |
parent | 60989e52b3f3bc0a95d3e61bd8e59fa4d9b7ab83 (diff) | |
download | QMidiPlayer-f7def0d883fa5cab62ef61b40b9f857245be8e6c.tar.xz |
Initial Qt 6 port. Many bug fixes.
Diffstat (limited to 'qmidiplayer-desktop/qmpinfowindow.cpp')
-rw-r--r-- | qmidiplayer-desktop/qmpinfowindow.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/qmidiplayer-desktop/qmpinfowindow.cpp b/qmidiplayer-desktop/qmpinfowindow.cpp index 654c8f4..fe46c18 100644 --- a/qmidiplayer-desktop/qmpinfowindow.cpp +++ b/qmidiplayer-desktop/qmpinfowindow.cpp @@ -1,4 +1,3 @@ -#include <QTextCodec> #include "qmpinfowindow.hpp" #include "ui_qmpinfowindow.h" #include "qmpmainwindow.hpp" @@ -51,20 +50,12 @@ void qmpInfoWindow::updateInfo() ui->lbFileName->setText(QString("File name: ") + qmpMainWindow::getInstance()->getFileName()); if (player->getTitle()) { - if (textencoding != "Unicode") - ui->lbTitle->setText(QString("Title: ") + - QTextCodec::codecForName(textencoding.c_str())->toUnicode(player->getTitle())); - else - ui->lbTitle->setText(QString("Title: ") + player->getTitle()); + ui->lbTitle->setText(QString("Title: %1").arg(qmpMainWindow::decodeString(player->getTitle()))); } else ui->lbTitle->setText(QString("Title: ")); if (player->getCopyright()) { - if (textencoding != "Unicode") - ui->lbCopyright->setText(QString("Copyright: ") + - QTextCodec::codecForName(textencoding.c_str())->toUnicode(player->getCopyright())); - else - ui->lbCopyright->setText(QString("Copyright: ") + player->getCopyright()); + ui->lbCopyright->setText(QString("Copyright: %1").arg(qmpMainWindow::decodeString(player->getCopyright()))); } else ui->lbCopyright->setText(QString("Copyright: ")); ui->lbTempo->setText(QString("Tempo: ") + QString::number(player->getTempo(), 'g', 5)); |