From d705543c2099e6cd690b6d8471a2250117c16d65 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Tue, 29 Aug 2023 10:04:29 +0300 Subject: [PATCH] Android: fix handling of tree content uri with sub-document Check for the index of last '/' from the non-encoded path. Amends ea75e34d6968bb59624874411e793c95b26d0dbe. Change-Id: I3ef5d454a46c711a85fe7ef01ea9d3d93a2d574f Reviewed-by: Ville Voutilainen (cherry picked from commit 4721721f6005c90cb1760b0c6e074468aa73512f) --- src/plugins/platforms/android/androidcontentfileengine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/android/androidcontentfileengine.cpp b/src/plugins/platforms/android/androidcontentfileengine.cpp index 728ecc49003..a6b5944dea1 100644 --- a/src/plugins/platforms/android/androidcontentfileengine.cpp +++ b/src/plugins/platforms/android/androidcontentfileengine.cpp @@ -635,7 +635,7 @@ DocumentFilePtr DocumentFile::parseFromAnyUri(const QString &fileName) const int treeIndex = encodedUri.indexOf(treeType); const int documentIndex = encodedUri.indexOf(documentType); - const int index = encodedUri.lastIndexOf(QUrl::toPercentEncoding(QLatin1String("/"))); + const int index = fileName.lastIndexOf(QLatin1Char('/')); if (index <= treeIndex + treeType.size() || index <= documentIndex + documentType.size()) return fromTreeUri(uri);