forked from len0rd/rockbox
rbutil: QString::split() changed with Qt 5.14.
Avoid a deprecated warning, and make it compile with Qt6, which removes the old version. Change-Id: Iaad10660a0c8bda9d7aa52ee250489ed135bd8a8
This commit is contained in:
parent
d5820ff779
commit
cd352d9052
4 changed files with 30 additions and 2 deletions
|
|
@ -295,7 +295,11 @@ QString TTSFestival::getVoiceInfo(QString voice)
|
||||||
Qt::CaseInsensitive, QRegExp::Wildcard));
|
Qt::CaseInsensitive, QRegExp::Wildcard));
|
||||||
LOG_INFO() << "voiceInfo w/o descr:" << response;
|
LOG_INFO() << "voiceInfo w/o descr:" << response;
|
||||||
response = response.remove(')');
|
response = response.remove(')');
|
||||||
|
#if QT_VERSION >= 0x050e00
|
||||||
|
QStringList responseLines = response.split('(', Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
QStringList responseLines = response.split('(', QString::SkipEmptyParts);
|
QStringList responseLines = response.split('(', QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
responseLines.removeAt(0); // the voice name itself
|
responseLines.removeAt(0); // the voice name itself
|
||||||
|
|
||||||
QString description;
|
QString description;
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,11 @@ QStringList TTSSapi::getVoiceList(QString language)
|
||||||
if(dataRaw.startsWith("Error")) {
|
if(dataRaw.startsWith("Error")) {
|
||||||
LOG_INFO() << "Error:" << dataRaw;
|
LOG_INFO() << "Error:" << dataRaw;
|
||||||
}
|
}
|
||||||
result = dataRaw.split(";",QString::SkipEmptyParts);
|
#if QT_VERSION >= 0x050e00
|
||||||
|
result = dataRaw.split(";", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
|
result = dataRaw.split(";", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
if(result.size() > 0)
|
if(result.size() > 0)
|
||||||
{
|
{
|
||||||
result.sort();
|
result.sort();
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,11 @@ QString Utils::resolvePathCase(QString path)
|
||||||
{
|
{
|
||||||
int start;
|
int start;
|
||||||
QString realpath;
|
QString realpath;
|
||||||
|
#if QT_VERSION >= 0x050e00
|
||||||
|
QStringList elems = path.split("/", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
QStringList elems = path.split("/", QString::SkipEmptyParts);
|
QStringList elems = path.split("/", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
|
|
||||||
if(path.isEmpty())
|
if(path.isEmpty())
|
||||||
return QString();
|
return QString();
|
||||||
|
|
@ -280,9 +284,17 @@ QString Utils::findExecutable(QString name)
|
||||||
QString exepath;
|
QString exepath;
|
||||||
//try autodetect tts
|
//try autodetect tts
|
||||||
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
|
#if defined(Q_OS_LINUX) || defined(Q_OS_MACX) || defined(Q_OS_OPENBSD)
|
||||||
|
#if QT_VERSION >= 0x050e00
|
||||||
|
QStringList path = QString(getenv("PATH")).split(":", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
QStringList path = QString(getenv("PATH")).split(":", QString::SkipEmptyParts);
|
QStringList path = QString(getenv("PATH")).split(":", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
|
#if QT_VERSION >= 0x050e00
|
||||||
|
QStringList path = QString(getenv("PATH")).split(";", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts);
|
QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
LOG_INFO() << "system path:" << path;
|
LOG_INFO() << "system path:" << path;
|
||||||
for(int i = 0; i < path.size(); i++)
|
for(int i = 0; i < path.size(); i++)
|
||||||
|
|
@ -290,7 +302,11 @@ QString Utils::findExecutable(QString name)
|
||||||
QString executable = QDir::fromNativeSeparators(path.at(i)) + "/" + name;
|
QString executable = QDir::fromNativeSeparators(path.at(i)) + "/" + name;
|
||||||
#if defined(Q_OS_WIN)
|
#if defined(Q_OS_WIN)
|
||||||
executable += ".exe";
|
executable += ".exe";
|
||||||
|
#if QT_VERSION >= 0x050e00
|
||||||
|
QStringList ex = executable.split("\"", Qt::SkipEmptyParts);
|
||||||
|
#else
|
||||||
QStringList ex = executable.split("\"", QString::SkipEmptyParts);
|
QStringList ex = executable.split("\"", QString::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
executable = ex.join("");
|
executable = ex.join("");
|
||||||
#endif
|
#endif
|
||||||
if(QFileInfo(executable).isExecutable())
|
if(QFileInfo(executable).isExecutable())
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,11 @@ void InstallTalkWindow::accept()
|
||||||
talkcreator->setStripExtensions(ui.StripExtensions->isChecked());
|
talkcreator->setStripExtensions(ui.StripExtensions->isChecked());
|
||||||
talkcreator->setTalkFolders(ui.talkFolders->isChecked());
|
talkcreator->setTalkFolders(ui.talkFolders->isChecked());
|
||||||
talkcreator->setTalkFiles(ui.talkFiles->isChecked());
|
talkcreator->setTalkFiles(ui.talkFiles->isChecked());
|
||||||
talkcreator->setIgnoreFiles(ui.ignoreFiles->text().split(",",QString::SkipEmptyParts));
|
#if QT_VERSION >= 0x050e00
|
||||||
|
talkcreator->setIgnoreFiles(ui.ignoreFiles->text().split(",", Qt::SkipEmptyParts));
|
||||||
|
#else
|
||||||
|
talkcreator->setIgnoreFiles(ui.ignoreFiles->text().split(",", QString::SkipEmptyParts));
|
||||||
|
#endif
|
||||||
|
|
||||||
connect(talkcreator, SIGNAL(done(bool)), logger, SLOT(setFinished()));
|
connect(talkcreator, SIGNAL(done(bool)), logger, SLOT(setFinished()));
|
||||||
connect(talkcreator, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
|
connect(talkcreator, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int)));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue