Skip to content

Commit 2366598

Browse files
committed
Remove QTextCodec usage
1 parent c75bfd2 commit 2366598

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

Engine/AppManager.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
#include <QDateTime>
8989
#include <QDebug>
9090
#include <QDir>
91-
#include <QTextCodec>
9291
#include <QCoreApplication>
9392
#include <QSettings>
9493
#include <QThreadPool>

Gui/AboutWindow.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ CLANG_DIAG_OFF(deprecated)
3737
#include <QVBoxLayout>
3838
#include <QTabWidget>
3939
#include <QFile>
40-
#include <QTextCodec>
4140
#include <QItemSelectionModel>
4241
#include <QHeaderView>
4342
#include <QDir>
@@ -130,7 +129,7 @@ AboutWindow::AboutWindow(QWidget* parent)
130129
QString licenseStr;
131130
QFile license( QString::fromUtf8(":LICENSE_SHORT.txt") );
132131
license.open(QIODevice::ReadOnly | QIODevice::Text);
133-
licenseStr = NATRON_NAMESPACE::convertFromPlainText(QTextCodec::codecForName("UTF-8")->toUnicode( license.readAll() ), NATRON_NAMESPACE::WhiteSpaceNormal);
132+
licenseStr = NATRON_NAMESPACE::convertFromPlainText(QString::fromUtf8( license.readAll() ), NATRON_NAMESPACE::WhiteSpaceNormal);
134133
aboutText.append(licenseStr);
135134
}
136135
{
@@ -445,7 +444,7 @@ AboutWindow::AboutWindow(QWidget* parent)
445444
{
446445
QFile changelogFile( QString::fromUtf8(":CHANGELOG.md") );
447446
changelogFile.open(QIODevice::ReadOnly | QIODevice::Text);
448-
_changelogText->setText( QTextCodec::codecForName("UTF-8")->toUnicode( changelogFile.readAll() ) );
447+
_changelogText->setText( QString::fromUtf8( changelogFile.readAll() ) );
449448
}
450449
_tabWidget->addTab( _changelogText, tr("Changelog") );
451450

@@ -460,7 +459,7 @@ AboutWindow::AboutWindow(QWidget* parent)
460459
{
461460
QFile team_file( QString::fromUtf8(":CONTRIBUTORS.txt") );
462461
team_file.open(QIODevice::ReadOnly | QIODevice::Text);
463-
_teamText->setText( QTextCodec::codecForName("UTF-8")->toUnicode( team_file.readAll() ) );
462+
_teamText->setText( QString::fromUtf8( team_file.readAll() ) );
464463
}
465464
_tabWidget->addTab( _teamText, tr("Contributors") );
466465

@@ -469,7 +468,7 @@ AboutWindow::AboutWindow(QWidget* parent)
469468
{
470469
QFile license( QString::fromUtf8(":LICENSE.txt") );
471470
license.open(QIODevice::ReadOnly | QIODevice::Text);
472-
_licenseText->setText( QTextCodec::codecForName("UTF-8")->toUnicode( license.readAll() ) );
471+
_licenseText->setText( QString::fromUtf8( license.readAll() ) );
473472
}
474473
_tabWidget->addTab( _licenseText, tr("License") );
475474

@@ -563,7 +562,7 @@ AboutWindow::onSelectionChanged(const QItemSelection & newSelection,
563562
fileName += ( item->text() == QString::fromUtf8("README") ) ? QString::fromUtf8(".md") : QString::fromUtf8(".txt");
564563
QFile file(fileName);
565564
if ( file.open(QIODevice::ReadOnly | QIODevice::Text) ) {
566-
QString content = QTextCodec::codecForName("UTF-8")->toUnicode( file.readAll() );
565+
QString content = QString::fromUtf8( file.readAll() );
567566
_thirdPartyBrowser->setText(content);
568567
}
569568
}

0 commit comments

Comments
 (0)