From ec35827669972c5655d67862d2770a862afd7fb1 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Tue, 2 Jan 2024 18:11:03 +0100 Subject: [PATCH] Fix opening temporary content: URIs from application content providers e5d591a0d09 focused on document or tree URIs you'd get from the file dialog, but we can also get ones via Intents from application-specific content providers (e.g. opening an attachment from an email client). Those need to be handled like a single document here, parsing them like a tree URI results in a bunch of Java exceptions down the line. Change-Id: I19cb1075fd6a3ccad927543f8bc5a63566f4877e Pick-to: 6.5 Reviewed-by: Assam Boudjelthia (cherry picked from commit 9d4a34bbbe7ec39ef594b07aae06fc1029cc6e3d) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 33b4c2d4af90d255b59ac79175c145f0e3299915) --- 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 be8b1a193f7..7b369cf6541 100644 --- a/src/plugins/platforms/android/androidcontentfileengine.cpp +++ b/src/plugins/platforms/android/androidcontentfileengine.cpp @@ -608,7 +608,7 @@ DocumentFilePtr DocumentFile::parseFromAnyUri(const QString &fileName) const QString encodedUri = QUrl(fileName).toEncoded(); const QJniObject uri = parseUri(encodedUri); - if (DocumentsContract::isDocumentUri(uri)) + if (DocumentsContract::isDocumentUri(uri) || !DocumentsContract::isTreeUri(uri)) return fromSingleUri(uri); const QString documentType = "/document/"_L1;