From 4721721f6005c90cb1760b0c6e074468aa73512f 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. Pick-to: 6.6 6.5 6.2 5.15 Change-Id: I3ef5d454a46c711a85fe7ef01ea9d3d93a2d574f Reviewed-by: Ville Voutilainen --- 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 4b3355c115e..be8b1a193f7 100644 --- a/src/plugins/platforms/android/androidcontentfileengine.cpp +++ b/src/plugins/platforms/android/androidcontentfileengine.cpp @@ -616,7 +616,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("/")); + const int index = fileName.lastIndexOf("/"); if (index <= treeIndex + treeType.size() || index <= documentIndex + documentType.size()) return fromTreeUri(uri);