Commit d2ae2c28 authored by Albert Astals Cid's avatar Albert Astals Cid

More fine tuning of the mime of the opened file

In fba90677 we introduced a "if we're
told this is a text file let's check the mime of the content only since
text files never fail to open".

This extends it to anything that inherits from text now, so if you
rename a PDF file to bla.php it still tries to open as a pdf first and
if that files as a php file
parent 33483a10
Pipeline #42061 passed with stage
in 27 minutes and 11 seconds
......@@ -1470,7 +1470,7 @@ bool Part::openFile()
mimes << pathMime << argMime;
}
if (mimes[0].name() == QLatin1String("text/plain")) {
if (mimes[0].inherits(QStringLiteral("text/plain"))) {
QMimeType contentMime = db.mimeTypeForFile(fileNameToOpen, QMimeDatabase::MatchContent);
mimes.prepend(contentMime);
}
......
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