ohos: Handle possible listVoices() error
listVoices() returned an empty vector both when the engine reported no
voices and when the query failed, so the caller could not tell the two
cases apart. Return std::optional instead and leave it unset on failure.
The engine constructor now reports that failure through setError(),
which fills errorReason() and errorString() and moves the engine to
QTextToSpeech::Error. Errors for speak() and stop() are delivered by the
JS engine's onError() callback and already go through setError(), so
both paths now converge on the same error state.
Task-number: QTBUG-147179
Pick-to: 6.12
Change-Id: Ie7871a3740526848a036123d93c49aeadbe9bd8e
Reviewed-by: Dawid Śliwa <dawid.sliwa@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>