forked from len0rd/rockbox
rbutil: Initial Qt6 support.
Qt6 replaces QTextStream::setCodec() with QTextStream::setEncoding(). Change-Id: I4cfa90d89f54ad49d061ad859585a2a74b5f9786
This commit is contained in:
parent
9cd37337de
commit
7c9a7ed406
4 changed files with 16 additions and 0 deletions
|
|
@ -143,7 +143,11 @@ bool TTSSapi::start(QString *errStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
voicestream = new QTextStream(voicescript);
|
voicestream = new QTextStream(voicescript);
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
voicestream->setCodec("UTF16-LE");
|
voicestream->setCodec("UTF16-LE");
|
||||||
|
#else
|
||||||
|
voicestream->setEncoding(QStringConverter::Utf16LE);
|
||||||
|
#endif
|
||||||
|
|
||||||
m_started = true;
|
m_started = true;
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -217,7 +217,11 @@ void VoiceFileCreator::create(void)
|
||||||
//read in downloaded file
|
//read in downloaded file
|
||||||
emit logItem(tr("Reading strings..."),LOGINFO);
|
emit logItem(tr("Reading strings..."),LOGINFO);
|
||||||
QTextStream in(&genlang);
|
QTextStream in(&genlang);
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
in.setCodec("UTF-8");
|
in.setCodec("UTF-8");
|
||||||
|
#else
|
||||||
|
in.setEncoding(QStringConverter::Utf8);
|
||||||
|
#endif
|
||||||
QString id, voice;
|
QString id, voice;
|
||||||
bool idfound = false;
|
bool idfound = false;
|
||||||
bool voicefound=false;
|
bool voicefound=false;
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,11 @@ QString Changelog::parseChangelogFile(QString filename)
|
||||||
QFile changelog(filename);
|
QFile changelog(filename);
|
||||||
changelog.open(QIODevice::ReadOnly);
|
changelog.open(QIODevice::ReadOnly);
|
||||||
QTextStream c(&changelog);
|
QTextStream c(&changelog);
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
c.setCodec(QTextCodec::codecForName("UTF-8"));
|
c.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||||
|
#else
|
||||||
|
c.setEncoding(QStringConverter::Utf8);
|
||||||
|
#endif
|
||||||
QString text;
|
QString text;
|
||||||
while(!c.atEnd()) {
|
while(!c.atEnd()) {
|
||||||
QString line = c.readLine();
|
QString line = c.readLine();
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,11 @@ void RbUtilQt::about()
|
||||||
QFile credits(":/docs/CREDITS");
|
QFile credits(":/docs/CREDITS");
|
||||||
credits.open(QIODevice::ReadOnly);
|
credits.open(QIODevice::ReadOnly);
|
||||||
QTextStream r(&credits);
|
QTextStream r(&credits);
|
||||||
|
#if QT_VERSION < 0x060000
|
||||||
r.setCodec(QTextCodec::codecForName("UTF-8"));
|
r.setCodec(QTextCodec::codecForName("UTF-8"));
|
||||||
|
#else
|
||||||
|
r.setEncoding(QStringConverter::Utf8);
|
||||||
|
#endif
|
||||||
while(!r.atEnd()) {
|
while(!r.atEnd()) {
|
||||||
QString line = r.readLine();
|
QString line = r.readLine();
|
||||||
// filter out header.
|
// filter out header.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue