From 8c416e01242f03294adb021ab438f42d44832e8a Mon Sep 17 00:00:00 2001 From: Jeremy Whiting Date: Mon, 7 Feb 2022 19:00:32 -0700 Subject: [PATCH] Add patch to reverse order of voices in QtSpeech. Bump pkgrel to 3 for this change. --- ...voices-before-returning-from-Speech-.patch | 31 +++++++++++++++++++ trunk/PKGBUILD | 13 ++++++-- 2 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 trunk/0001-Reverse-list-of-voices-before-returning-from-Speech-.patch diff --git a/trunk/0001-Reverse-list-of-voices-before-returning-from-Speech-.patch b/trunk/0001-Reverse-list-of-voices-before-returning-from-Speech-.patch new file mode 100644 index 0000000..69359d8 --- /dev/null +++ b/trunk/0001-Reverse-list-of-voices-before-returning-from-Speech-.patch @@ -0,0 +1,31 @@ +From 6ad7b2894b9ab0730f62202c0eefae61bccd1dc9 Mon Sep 17 00:00:00 2001 +From: Jeremy Whiting +Date: Sat, 30 Oct 2021 23:02:26 -0600 +Subject: [PATCH] Reverse list of voices before returning from + Speech-Dispatcher. + +Since QMultiMap::values() gives voices in reverse order from the order +inserted (latest first, oldest last) reverse the list before returning +it to users. +--- + src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp b/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp +index 5fd3bc2..0d2a36e 100644 +--- a/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp ++++ b/src/plugins/tts/speechdispatcher/qtexttospeech_speechd.cpp +@@ -357,7 +357,9 @@ QVector QTextToSpeechEngineSpeechd::availableLocales() const + + QVector QTextToSpeechEngineSpeechd::availableVoices() const + { +- return m_voices.values(m_currentLocale.name()).toVector(); ++ QList resultList = m_voices.values(m_currentLocale.name()); ++ std::reverse(resultList.begin(), resultList.end()); ++ return resultList.toVector(); + } + + // We have no way of knowing our own client_id since speech-dispatcher seems to be incomplete +-- +2.33.0.windows.2 + diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD index 57865c0..48e76c6 100644 --- a/trunk/PKGBUILD +++ b/trunk/PKGBUILD @@ -4,7 +4,7 @@ pkgname=qt5-speech _qtver=5.15.2 pkgver=${_qtver/-/} -pkgrel=2 +pkgrel=3 arch=(x86_64) url='https://www.qt.io' license=(GPL3 LGPL3 FDL custom) @@ -14,12 +14,19 @@ makedepends=(flite speech-dispatcher) optdepends=('flite: flite TTS backend' 'speech-dispatcher: speech-dispatcher TTS backend') groups=(qt qt5) _pkgfqn="${pkgname/5-/}-everywhere-src-${_qtver}" -source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz") -sha256sums=('c810fb9eecb08026434422a32e79269627f3bc2941be199e86ec410bdfe883f5') +source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz" + 0001-Reverse-list-of-voices-before-returning-from-Speech-.patch + ) +sha256sums=('c810fb9eecb08026434422a32e79269627f3bc2941be199e86ec410bdfe883f5' + '249e6da98fbab23cba75421742a363f84783c602ba320fa8edb13737d4a5336f' + ) options=(debug) prepare() { mkdir -p build + cd ${_pkgfqn} + echo "Applying patch 0001-Reverse-list-of-voices-before-returning-from-Speech-.patch ..." + patch -p1 < "../0001-Reverse-list-of-voices-before-returning-from-Speech-.patch" } build() { -- 2.35.1