From 23665984ca9a29071d2cdf9d1ee0699552a2f2dc Mon Sep 17 00:00:00 2001 From: Aaron Colwell <300262+acolwell@users.noreply.github.com> Date: Sat, 3 May 2025 16:06:06 -0700 Subject: [PATCH] Remove QTextCodec usage --- Engine/AppManager.cpp | 1 - Gui/AboutWindow.cpp | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Engine/AppManager.cpp b/Engine/AppManager.cpp index 9174556ee2..071f46b2d5 100644 --- a/Engine/AppManager.cpp +++ b/Engine/AppManager.cpp @@ -88,7 +88,6 @@ #include #include #include -#include #include #include #include diff --git a/Gui/AboutWindow.cpp b/Gui/AboutWindow.cpp index 8dc8f5fdab..4a24180539 100644 --- a/Gui/AboutWindow.cpp +++ b/Gui/AboutWindow.cpp @@ -37,7 +37,6 @@ CLANG_DIAG_OFF(deprecated) #include #include #include -#include #include #include #include @@ -130,7 +129,7 @@ AboutWindow::AboutWindow(QWidget* parent) QString licenseStr; QFile license( QString::fromUtf8(":LICENSE_SHORT.txt") ); license.open(QIODevice::ReadOnly | QIODevice::Text); - licenseStr = NATRON_NAMESPACE::convertFromPlainText(QTextCodec::codecForName("UTF-8")->toUnicode( license.readAll() ), NATRON_NAMESPACE::WhiteSpaceNormal); + licenseStr = NATRON_NAMESPACE::convertFromPlainText(QString::fromUtf8( license.readAll() ), NATRON_NAMESPACE::WhiteSpaceNormal); aboutText.append(licenseStr); } { @@ -445,7 +444,7 @@ AboutWindow::AboutWindow(QWidget* parent) { QFile changelogFile( QString::fromUtf8(":CHANGELOG.md") ); changelogFile.open(QIODevice::ReadOnly | QIODevice::Text); - _changelogText->setText( QTextCodec::codecForName("UTF-8")->toUnicode( changelogFile.readAll() ) ); + _changelogText->setText( QString::fromUtf8( changelogFile.readAll() ) ); } _tabWidget->addTab( _changelogText, tr("Changelog") ); @@ -460,7 +459,7 @@ AboutWindow::AboutWindow(QWidget* parent) { QFile team_file( QString::fromUtf8(":CONTRIBUTORS.txt") ); team_file.open(QIODevice::ReadOnly | QIODevice::Text); - _teamText->setText( QTextCodec::codecForName("UTF-8")->toUnicode( team_file.readAll() ) ); + _teamText->setText( QString::fromUtf8( team_file.readAll() ) ); } _tabWidget->addTab( _teamText, tr("Contributors") ); @@ -469,7 +468,7 @@ AboutWindow::AboutWindow(QWidget* parent) { QFile license( QString::fromUtf8(":LICENSE.txt") ); license.open(QIODevice::ReadOnly | QIODevice::Text); - _licenseText->setText( QTextCodec::codecForName("UTF-8")->toUnicode( license.readAll() ) ); + _licenseText->setText( QString::fromUtf8( license.readAll() ) ); } _tabWidget->addTab( _licenseText, tr("License") ); @@ -563,7 +562,7 @@ AboutWindow::onSelectionChanged(const QItemSelection & newSelection, fileName += ( item->text() == QString::fromUtf8("README") ) ? QString::fromUtf8(".md") : QString::fromUtf8(".txt"); QFile file(fileName); if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) { - QString content = QTextCodec::codecForName("UTF-8")->toUnicode( file.readAll() ); + QString content = QString::fromUtf8( file.readAll() ); _thirdPartyBrowser->setText(content); } }