forked from qt-creator/qt-creator
MimeData: Never detect anything as application/x-zerosize
- That mime type is pretty useless - If there are two mime types that match a file by glob pattern, the mime database implementation will find the best matching mime type by data of *all* mime types and take that instead (this doesn't make sense btw). That means that if .h is matched by c-hdr and c++-hdr, empty .h files are detected as mime type application/x-zerosize, which is pretty useless Change-Id: I4f9d532ef1efd29df00279c693486c92611485a8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com> Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com> Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
@@ -135,10 +135,10 @@ static inline bool isTextFile(const QByteArray &data)
|
||||
|
||||
MimeType MimeDatabasePrivate::findByData(const QByteArray &data, int *accuracyPtr)
|
||||
{
|
||||
if (data.isEmpty()) {
|
||||
*accuracyPtr = 100;
|
||||
return mimeTypeForName(QLatin1String("application/x-zerosize"));
|
||||
}
|
||||
// if (data.isEmpty()) {
|
||||
// *accuracyPtr = 100;
|
||||
// return mimeTypeForName(QLatin1String("application/x-zerosize"));
|
||||
// }
|
||||
|
||||
*accuracyPtr = 0;
|
||||
MimeType candidate = provider()->findByMagic(data, accuracyPtr);
|
||||
|
Reference in New Issue
Block a user