Commit e7967bea authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Fix attachment mimetype detection

We want to resolve the mimetype from the content only if
QMimeType doesn't now the mimetype or the mimetype is not
valid. This matches the behavior of KMimeType (and this
code) in KDE4.

BUG: 407871
FIXED-IN: 5.16
parent 472f2d26
Pipeline #39649 passed with stage
in 17 minutes and 28 seconds
......@@ -133,7 +133,7 @@ void AttachmentIconItem::readAttachment()
QMimeDatabase db;
if (mAttachment.mimeType().isEmpty()
|| !(db.mimeTypeForName(mAttachment.mimeType()).isDefault())) {
|| !(db.mimeTypeForName(mAttachment.mimeType()).isValid())) {
QMimeType mimeType;
if (mAttachment.isUri()) {
mimeType = db.mimeTypeForUrl(QUrl(mAttachment.uri()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment