diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-09-24 17:48:16 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-09-24 21:35:30 +0200 |
commit | 29df77b4cdb1535423e4b064d0370ab3af623c11 (patch) | |
tree | 95b5918541bf7980c42f3fa9f88249c614bfa929 /src | |
parent | ec89cffeef4759b183658d24c34e7335875151f0 (diff) |
JNI: Don't use "Object" methods, let the compiler do the work
The return type is an object type, so we get a QJniObject anyway.
Change-Id: I6d1e095142e3e4dbfabcab0fe7597af47513f6e9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/tts/android/src/qtexttospeech_android.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/tts/android/src/qtexttospeech_android.cpp b/src/plugins/tts/android/src/qtexttospeech_android.cpp index 88bf19e..2b166c0 100644 --- a/src/plugins/tts/android/src/qtexttospeech_android.cpp +++ b/src/plugins/tts/android/src/qtexttospeech_android.cpp @@ -440,8 +440,8 @@ QLocale QTextToSpeechEngineAndroid::locale() const { auto locale = m_speech.callMethod<QtJniTypes::Locale>("getLocale"); if (locale.isValid()) { - auto localeLanguage = locale.callObjectMethod<jstring>("getLanguage").toString(); - auto localeCountry = locale.callObjectMethod<jstring>("getCountry").toString(); + auto localeLanguage = locale.callMethod<jstring>("getLanguage").toString(); + auto localeCountry = locale.callMethod<jstring>("getCountry").toString(); if (!localeCountry.isEmpty()) localeLanguage += QString("_%1").arg(localeCountry).toUpper(); return QLocale(localeLanguage); @@ -451,7 +451,7 @@ QLocale QTextToSpeechEngineAndroid::locale() const QVoice QTextToSpeechEngineAndroid::javaVoiceObjectToQVoice(QJniObject &obj) const { - auto voiceName = obj.callObjectMethod<jstring>("getName").toString(); + auto voiceName = obj.callMethod<jstring>("getName").toString(); QVoice::Gender gender; if (voiceName.contains(QStringLiteral("#male"))) { gender = QVoice::Male; @@ -463,8 +463,8 @@ QVoice QTextToSpeechEngineAndroid::javaVoiceObjectToQVoice(QJniObject &obj) cons QJniObject locale = obj.callMethod<QtJniTypes::Locale>("getLocale"); QLocale qlocale; if (locale.isValid()) { - auto localeLanguage = locale.callObjectMethod<jstring>("getLanguage").toString(); - auto localeCountry = locale.callObjectMethod<jstring>("getCountry").toString(); + auto localeLanguage = locale.callMethod<jstring>("getLanguage").toString(); + auto localeCountry = locale.callMethod<jstring>("getCountry").toString(); if (!localeCountry.isEmpty()) localeLanguage += QString("_%1").arg(localeCountry).toUpper(); qlocale = QLocale(localeLanguage); |