forked from qt-creator/qt-creator
Remove unneeded checks for validity of mime types
mimeTypeForFile(...) is documented to never return an invalid mime type (it will fall back to binary if everything else fails), so remove unneeded checks. This also removes fallback code that used text/plain in case of invalid mime type, which is probably a relict from the old mime implementation. Change-Id: I88ed41fa3b81704f110f9f481b0f01424a487cbb Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -51,8 +51,6 @@ ProjectFile::Kind ProjectFile::classify(const QString &filePath)
|
||||
return AmbiguousHeader;
|
||||
|
||||
const Utils::MimeType mimeType = Utils::mimeTypeForFile(filePath);
|
||||
if (!mimeType.isValid())
|
||||
return Unsupported;
|
||||
const QString mt = mimeType.name();
|
||||
if (mt == QLatin1String(CppTools::Constants::C_SOURCE_MIMETYPE))
|
||||
return CSource;
|
||||
|
||||
Reference in New Issue
Block a user