diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-07-27 22:31:26 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2020-08-16 12:15:14 +0200 |
commit | cd352d9052b42781887996da5b0691dd581ce48c (patch) | |
tree | fc0ba0825a711e4cdacf30c008fc7f14e3d0a4a4 | |
parent | d5820ff779397c9de50286d401c5d6422fb84fcb (diff) | |
download | rockbox-cd352d9052b42781887996da5b0691dd581ce48c.tar.gz rockbox-cd352d9052b42781887996da5b0691dd581ce48c.zip |
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
-rw-r--r-- | rbutil/rbutilqt/base/ttsfestival.cpp | 4 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/ttssapi.cpp | 6 | ||||
-rw-r--r-- | rbutil/rbutilqt/base/utils.cpp | 16 | ||||
-rw-r--r-- | rbutil/rbutilqt/installtalkwindow.cpp | 6 |
4 files changed, 30 insertions, 2 deletions
diff --git a/rbutil/rbutilqt/base/ttsfestival.cpp b/rbutil/rbutilqt/base/ttsfestival.cpp index 41358ba488..6ed08ddacc 100644 --- a/rbutil/rbutilqt/base/ttsfestival.cpp +++ b/rbutil/rbutilqt/base/ttsfestival.cpp | |||
@@ -295,7 +295,11 @@ QString TTSFestival::getVoiceInfo(QString voice) | |||
295 | Qt::CaseInsensitive, QRegExp::Wildcard)); | 295 | Qt::CaseInsensitive, QRegExp::Wildcard)); |
296 | LOG_INFO() << "voiceInfo w/o descr:" << response; | 296 | LOG_INFO() << "voiceInfo w/o descr:" << response; |
297 | response = response.remove(')'); | 297 | response = response.remove(')'); |
298 | #if QT_VERSION >= 0x050e00 | ||
299 | QStringList responseLines = response.split('(', Qt::SkipEmptyParts); | ||
300 | #else | ||
298 | QStringList responseLines = response.split('(', QString::SkipEmptyParts); | 301 | QStringList responseLines = response.split('(', QString::SkipEmptyParts); |
302 | #endif | ||
299 | responseLines.removeAt(0); // the voice name itself | 303 | responseLines.removeAt(0); // the voice name itself |
300 | 304 | ||
301 | QString description; | 305 | QString description; |
diff --git a/rbutil/rbutilqt/base/ttssapi.cpp b/rbutil/rbutilqt/base/ttssapi.cpp index d2d8cf801a..3d07c09a98 100644 --- a/rbutil/rbutilqt/base/ttssapi.cpp +++ b/rbutil/rbutilqt/base/ttssapi.cpp | |||
@@ -204,7 +204,11 @@ QStringList TTSSapi::getVoiceList(QString language) | |||
204 | if(dataRaw.startsWith("Error")) { | 204 | if(dataRaw.startsWith("Error")) { |
205 | LOG_INFO() << "Error:" << dataRaw; | 205 | LOG_INFO() << "Error:" << dataRaw; |
206 | } | 206 | } |
207 | result = dataRaw.split(";",QString::SkipEmptyParts); | 207 | #if QT_VERSION >= 0x050e00 |
208 | result = dataRaw.split(";", Qt::SkipEmptyParts); | ||
209 | #else | ||
210 | result = dataRaw.split(";", QString::SkipEmptyParts); | ||
211 | #endif | ||
208 | if(result.size() > 0) | 212 | if(result.size() > 0) |
209 | { | 213 | { |
210 | result.sort(); | 214 | result.sort(); |
diff --git a/rbutil/rbutilqt/base/utils.cpp b/rbutil/rbutilqt/base/utils.cpp index e185effe2b..277dcb512c 100644 --- a/rbutil/rbutilqt/base/utils.cpp +++ b/rbutil/rbutilqt/base/utils.cpp | |||
@@ -93,7 +93,11 @@ QString Utils::resolvePathCase(QString path) | |||
93 | { | 93 | { |
94 | int start; | 94 | int start; |
95 | QString realpath; | 95 | QString realpath; |
96 | #if QT_VERSION >= 0x050e00 | ||
97 | QStringList elems = path.split("/", Qt::SkipEmptyParts); | ||
98 | #else | ||
96 | QStringList elems = path.split("/", QString::SkipEmptyParts); | 99 | QStringList elems = path.split("/", QString::SkipEmptyParts); |
100 | #endif | ||
97 | 101 | ||
98 | if(path.isEmpty()) | 102 | if(path.isEmpty()) |
99 | return QString(); | 103 | return QString(); |
@@ -280,17 +284,29 @@ QString Utils::findExecutable(QString name) | |||
280 | QString exepath; | 284 | QString exepath; |
281 | //try autodetect tts | 285 | //try autodetect tts |
282 | #if defined(Q_OS_LINUX) || defined(Q_OS_MACX) || defined(Q_OS_OPENBSD) | 286 | #if defined(Q_OS_LINUX) || defined(Q_OS_MACX) || defined(Q_OS_OPENBSD) |
287 | #if QT_VERSION >= 0x050e00 | ||
288 | QStringList path = QString(getenv("PATH")).split(":", Qt::SkipEmptyParts); | ||
289 | #else | ||
283 | QStringList path = QString(getenv("PATH")).split(":", QString::SkipEmptyParts); | 290 | QStringList path = QString(getenv("PATH")).split(":", QString::SkipEmptyParts); |
291 | #endif | ||
284 | #elif defined(Q_OS_WIN) | 292 | #elif defined(Q_OS_WIN) |
293 | #if QT_VERSION >= 0x050e00 | ||
294 | QStringList path = QString(getenv("PATH")).split(";", Qt::SkipEmptyParts); | ||
295 | #else | ||
285 | QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts); | 296 | QStringList path = QString(getenv("PATH")).split(";", QString::SkipEmptyParts); |
286 | #endif | 297 | #endif |
298 | #endif | ||
287 | LOG_INFO() << "system path:" << path; | 299 | LOG_INFO() << "system path:" << path; |
288 | for(int i = 0; i < path.size(); i++) | 300 | for(int i = 0; i < path.size(); i++) |
289 | { | 301 | { |
290 | QString executable = QDir::fromNativeSeparators(path.at(i)) + "/" + name; | 302 | QString executable = QDir::fromNativeSeparators(path.at(i)) + "/" + name; |
291 | #if defined(Q_OS_WIN) | 303 | #if defined(Q_OS_WIN) |
292 | executable += ".exe"; | 304 | executable += ".exe"; |
305 | #if QT_VERSION >= 0x050e00 | ||
306 | QStringList ex = executable.split("\"", Qt::SkipEmptyParts); | ||
307 | #else | ||
293 | QStringList ex = executable.split("\"", QString::SkipEmptyParts); | 308 | QStringList ex = executable.split("\"", QString::SkipEmptyParts); |
309 | #endif | ||
294 | executable = ex.join(""); | 310 | executable = ex.join(""); |
295 | #endif | 311 | #endif |
296 | if(QFileInfo(executable).isExecutable()) | 312 | if(QFileInfo(executable).isExecutable()) |
diff --git a/rbutil/rbutilqt/installtalkwindow.cpp b/rbutil/rbutilqt/installtalkwindow.cpp index d9f2cc7e98..81552b03db 100644 --- a/rbutil/rbutilqt/installtalkwindow.cpp +++ b/rbutil/rbutilqt/installtalkwindow.cpp | |||
@@ -111,7 +111,11 @@ void InstallTalkWindow::accept() | |||
111 | talkcreator->setStripExtensions(ui.StripExtensions->isChecked()); | 111 | talkcreator->setStripExtensions(ui.StripExtensions->isChecked()); |
112 | talkcreator->setTalkFolders(ui.talkFolders->isChecked()); | 112 | talkcreator->setTalkFolders(ui.talkFolders->isChecked()); |
113 | talkcreator->setTalkFiles(ui.talkFiles->isChecked()); | 113 | talkcreator->setTalkFiles(ui.talkFiles->isChecked()); |
114 | talkcreator->setIgnoreFiles(ui.ignoreFiles->text().split(",",QString::SkipEmptyParts)); | 114 | #if QT_VERSION >= 0x050e00 |
115 | talkcreator->setIgnoreFiles(ui.ignoreFiles->text().split(",", Qt::SkipEmptyParts)); | ||
116 | #else | ||
117 | talkcreator->setIgnoreFiles(ui.ignoreFiles->text().split(",", QString::SkipEmptyParts)); | ||
118 | #endif | ||
115 | 119 | ||
116 | connect(talkcreator, SIGNAL(done(bool)), logger, SLOT(setFinished())); | 120 | connect(talkcreator, SIGNAL(done(bool)), logger, SLOT(setFinished())); |
117 | connect(talkcreator, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); | 121 | connect(talkcreator, SIGNAL(logItem(QString, int)), logger, SLOT(addItem(QString, int))); |