aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/mimetypes
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@theqtcompany.com>2015-02-18 14:36:34 +0100
committerEike Ziller <eike.ziller@theqtcompany.com>2015-02-18 14:52:27 +0000
commit09716d64b3d12dde440504cac4972a172425ff15 (patch)
tree6e4882f626a8ced537b2414f278a95e3c4f3ee07 /src/libs/utils/mimetypes
parent73e2b0c579f14dc7b776430ae5ac4f88a6a7b2b9 (diff)
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>
Diffstat (limited to 'src/libs/utils/mimetypes')
-rw-r--r--src/libs/utils/mimetypes/mimedatabase.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libs/utils/mimetypes/mimedatabase.cpp b/src/libs/utils/mimetypes/mimedatabase.cpp
index 32629a74edb..47146553512 100644
--- a/src/libs/utils/mimetypes/mimedatabase.cpp
+++ b/src/libs/utils/mimetypes/mimedatabase.cpp
@@ -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);