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.7 6.6 6.5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Volker Krause 2024-01-02 18:11:03 +01:00
parent 11333a0972
commit 9d4a34bbbe

View File

@ -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;