diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-04-16 13:23:39 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-04-16 13:23:43 +0200 |
commit | 73af0bb7813196a14d1dd37da8c72d964c2904b3 (patch) | |
tree | c3ac2c39bdd963799a594f0a2f841738ef089713 | |
parent | 31953f04470f51493073ce8645c15e2cac2fbeb1 (diff) | |
parent | 9a773b0573c4c35d99d7d2f4314c26962c783602 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I519dc60497f29a37782bf588a774ad203b4a2bcc
-rw-r--r-- | dist/changes-5.14.1 | 20 | ||||
-rw-r--r-- | src/tts/qtexttospeech.cpp | 8 | ||||
-rw-r--r-- | src/tts/qtexttospeech_p.h | 5 | ||||
-rw-r--r-- | tests/auto/texttospeech/BLACKLIST | 1 | ||||
-rw-r--r-- | tests/auto/texttospeech/tst_qtexttospeech.cpp | 27 |
5 files changed, 46 insertions, 15 deletions
diff --git a/dist/changes-5.14.1 b/dist/changes-5.14.1 new file mode 100644 index 0000000..d008638 --- /dev/null +++ b/dist/changes-5.14.1 @@ -0,0 +1,20 @@ +Qt 5.14.1 is a bug-fix release. It maintains both forward and backward +compatibility (source and binary) with Qt 5.14.0. + +For more details, refer to the online documentation included in this +distribution. The documentation is also available online: + +https://doc.qt.io/qt-5/index.html + +The Qt version 5.14 series is binary compatible with the 5.13.x series. +Applications compiled for 5.13 will continue to run with 5.14. + +Some of the changes listed in this file include issue tracking numbers +corresponding to tasks in the Qt Bug Tracker: + +https://bugreports.qt.io/ + +Each of these identifiers can be entered in the bug tracker to obtain more +information about a particular change. + + - This release contains only minor code improvements. diff --git a/src/tts/qtexttospeech.cpp b/src/tts/qtexttospeech.cpp index f6e0f1a..2f394e1 100644 --- a/src/tts/qtexttospeech.cpp +++ b/src/tts/qtexttospeech.cpp @@ -129,9 +129,9 @@ void QTextToSpeechPrivate::loadPlugin() m_plugin = qobject_cast<QTextToSpeechPlugin *>(loader()->instance(idx)); } -QHash<QString, QJsonObject> QTextToSpeechPrivate::plugins(bool reload) +QMultiHash<QString, QJsonObject> QTextToSpeechPrivate::plugins(bool reload) { - static QHash<QString, QJsonObject> plugins; + static QMultiHash<QString, QJsonObject> plugins; static bool alreadyDiscovered = false; QMutexLocker lock(&m_mutex); @@ -145,14 +145,14 @@ QHash<QString, QJsonObject> QTextToSpeechPrivate::plugins(bool reload) return plugins; } -void QTextToSpeechPrivate::loadPluginMetadata(QHash<QString, QJsonObject> &list) +void QTextToSpeechPrivate::loadPluginMetadata(QMultiHash<QString, QJsonObject> &list) { QFactoryLoader *l = loader(); QList<QJsonObject> meta = l->metaData(); for (int i = 0; i < meta.size(); ++i) { QJsonObject obj = meta.at(i).value(QLatin1String("MetaData")).toObject(); obj.insert(QLatin1String("index"), i); - list.insertMulti(obj.value(QLatin1String("Provider")).toString(), obj); + list.insert(obj.value(QLatin1String("Provider")).toString(), obj); } } diff --git a/src/tts/qtexttospeech_p.h b/src/tts/qtexttospeech_p.h index c6e213e..c9b065b 100644 --- a/src/tts/qtexttospeech_p.h +++ b/src/tts/qtexttospeech_p.h @@ -53,6 +53,7 @@ #include <qtexttospeech.h> #include <qtexttospeechplugin.h> #include <QMutex> +#include <QtCore/qhash.h> #include <QtCore/private/qobject_p.h> QT_BEGIN_NAMESPACE @@ -63,13 +64,13 @@ class QTextToSpeechPrivate : public QObjectPrivate public: QTextToSpeechPrivate(QTextToSpeech *speech, const QString &engine); ~QTextToSpeechPrivate(); - static QHash<QString, QJsonObject> plugins(bool reload = false); + static QMultiHash<QString, QJsonObject> plugins(bool reload = false); QTextToSpeechEngine *m_engine; private: bool loadMeta(); void loadPlugin(); - static void loadPluginMetadata(QHash<QString, QJsonObject> &list); + static void loadPluginMetadata(QMultiHash<QString, QJsonObject> &list); QTextToSpeech *m_speech; QString m_providerName; QTextToSpeechPlugin *m_plugin; diff --git a/tests/auto/texttospeech/BLACKLIST b/tests/auto/texttospeech/BLACKLIST index 59c742c..caf25c3 100644 --- a/tests/auto/texttospeech/BLACKLIST +++ b/tests/auto/texttospeech/BLACKLIST @@ -5,6 +5,7 @@ ubuntu qemu b2qt rhel +opensuse-leap-15.1 [speech_rate] * [pitch] diff --git a/tests/auto/texttospeech/tst_qtexttospeech.cpp b/tests/auto/texttospeech/tst_qtexttospeech.cpp index 9996659..dce6d81 100644 --- a/tests/auto/texttospeech/tst_qtexttospeech.cpp +++ b/tests/auto/texttospeech/tst_qtexttospeech.cpp @@ -47,11 +47,14 @@ #endif #endif +enum : int { SpeechDuration = 20000 }; + class tst_QTextToSpeech : public QObject { Q_OBJECT private slots: + void initTestCase(); void say_hello(); void speech_rate(); void pitch(); @@ -59,6 +62,12 @@ private slots: void volume(); }; +void tst_QTextToSpeech::initTestCase() +{ +#if QT_CONFIG(speechd) && defined(LIBSPEECHD_MAJOR_VERSION) && defined(LIBSPEECHD_MINOR_VERSION) + qInfo("Using libspeechd v%d.%d", LIBSPEECHD_MAJOR_VERSION, LIBSPEECHD_MINOR_VERSION); +#endif +} void tst_QTextToSpeech::say_hello() { @@ -70,9 +79,9 @@ void tst_QTextToSpeech::say_hello() timer.start(); tts.say(text); QTRY_COMPARE(tts.state(), QTextToSpeech::Speaking); - QSignalSpy spy(&tts, SIGNAL(stateChanged(QTextToSpeech::State))); - spy.wait(10000); - QCOMPARE(tts.state(), QTextToSpeech::Ready); + QSignalSpy spy(&tts, &QTextToSpeech::stateChanged); + QVERIFY(spy.wait(SpeechDuration)); + QCOMPARE(int(tts.state()), int(QTextToSpeech::Ready)); QVERIFY(timer.elapsed() > 100); } @@ -94,9 +103,9 @@ void tst_QTextToSpeech::speech_rate() timer.start(); tts.say(text); QTRY_COMPARE(tts.state(), QTextToSpeech::Speaking); - QSignalSpy spy(&tts, SIGNAL(stateChanged(QTextToSpeech::State))); - spy.wait(10000); - QCOMPARE(tts.state(), QTextToSpeech::Ready); + QSignalSpy spy(&tts, &QTextToSpeech::stateChanged); + QVERIFY(spy.wait(SpeechDuration)); + QCOMPARE(int(tts.state()), int(QTextToSpeech::Ready)); qint64 time = timer.elapsed(); QVERIFY(time > lastTime); lastTime = time; @@ -134,9 +143,9 @@ void tst_QTextToSpeech::set_voice() timer.start(); tts.say(text); QTRY_COMPARE(tts.state(), QTextToSpeech::Speaking); - QSignalSpy spy(&tts, SIGNAL(stateChanged(QTextToSpeech::State))); - spy.wait(10000); - QCOMPARE(tts.state(), QTextToSpeech::Ready); + QSignalSpy spy(&tts, &QTextToSpeech::stateChanged); + QVERIFY(spy.wait(SpeechDuration)); + QCOMPARE(int(tts.state()), int(QTextToSpeech::Ready)); QVERIFY(timer.elapsed() > 100); } |