diff options
| author | Assam Boudjelthia <[email protected]> | 2023-05-03 16:53:19 +0300 |
|---|---|---|
| committer | Assam Boudjelthia <[email protected]> | 2023-05-05 17:40:46 +0300 |
| commit | ac8a39c416a5037ca253919fa61a08b4c501906c (patch) | |
| tree | 6d9f469af16ee08f67c12c20654facdf1fb97d8e /src/plugins/platforms/android/androidcontentfileengine.cpp | |
| parent | b6d5d419cce1134a2e71723e4323ecfa2e70f13c (diff) | |
Android: fix content url handling of filenames with spaces
The Android APIs expect the content url filenames to have
percent encoded spaces, so handle that internally, if missing,
under the content file engine.
Fixes: QTBUG-112663
Pick-to: 6.5 6.2 5.15
Change-Id: Ieb2ee41a2587f985b589ca54b88f1cff89992154
Reviewed-by: Ville Voutilainen <[email protected]>
Diffstat (limited to 'src/plugins/platforms/android/androidcontentfileengine.cpp')
| -rw-r--r-- | src/plugins/platforms/android/androidcontentfileengine.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/platforms/android/androidcontentfileengine.cpp b/src/plugins/platforms/android/androidcontentfileengine.cpp index 64868900189..ed2238c87cb 100644 --- a/src/plugins/platforms/android/androidcontentfileengine.cpp +++ b/src/plugins/platforms/android/androidcontentfileengine.cpp @@ -593,10 +593,14 @@ DocumentFile::DocumentFile(const QJniObject &uri, QJniObject parseUri(const QString &uri) { + QString uriToParse = uri; + if (uriToParse.contains(' ')) + uriToParse.replace(' ', QUrl::toPercentEncoding(" ")); + return QJniObject::callStaticMethod<QtJniTypes::UriType>( QtJniTypes::className<QtJniTypes::Uri>(), "parse", - QJniObject::fromString(uri).object<jstring>()); + QJniObject::fromString(uriToParse).object<jstring>()); } DocumentFilePtr DocumentFile::parseFromAnyUri(const QString &fileName) |
