Commit 1281004f authored by Nate Graham's avatar Nate Graham
Browse files

Revert "Prefer mime type from content over file name when loading"

This reverts commit 6a79391a.

That commit caused Gwenview to lose the ability to open RAW files. This
is a more serious regression than the bug being fixed by the commit
(329140), so it needs to be reverted for now until that bug can be
fixed in a way that doesn't regress RAW loading.

BUG: 441698
FIXED-IN: 21.12.2

CCMAIL: ahiemstra@heimr.nl
parent 4d7aa1a8
Pipeline #132319 skipped
......@@ -115,14 +115,12 @@ struct LoadingDocumentImplPrivate {
{
const QUrl &url = q->document()->url();
QMimeDatabase db;
auto mime = db.mimeTypeForData(mData);
if (mime.isDefault() && KProtocolInfo::determineMimetypeFromExtension(url.scheme())) {
mime = db.mimeTypeForFileNameAndData(url.fileName(), mData);
if (KProtocolInfo::determineMimetypeFromExtension(url.scheme())) {
mMimeType = db.mimeTypeForFileNameAndData(url.fileName(), mData);
} else {
mMimeType = db.mimeTypeForData(mData);
}
mMimeType = mime;
MimeTypeUtils::Kind kind = MimeTypeUtils::mimeTypeKind(mMimeType.name());
LOG("mimeType:" << mMimeType.name());
LOG("kind:" << kind);
......
Supports Markdown
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