This is due to the search in the suffix tree starting at position
fileName.length() - 1.
Change-Id: I98501c1724c7dde2626351ace8ba19faa0d2e1e1
Reviewed-by: Ivan Komissarov <ABBAPOH@nextmail.ru>
Reviewed-by: Wolf-Michael Bolle <wolf-michael.bolle@nokia.com>
QStringList QMimeBinaryProvider::findByFileName(const QString &fileName, QString *foundSuffix)
{
checkCache();
+ if (fileName.isEmpty())
+ return QStringList();
const QString lowerFileName = fileName.toLower();
QMimeGlobMatchResult result;
// TODO this parses in the order (local, global). Check that it handles "NOGLOBS" correctly.
QTest::newRow("directory") << "/" << "inode/directory";
QTest::newRow("doesn't exist, no extension") << "IDontExist" << "application/octet-stream";
QTest::newRow("doesn't exist but has known extension") << "IDontExist.txt" << "text/plain";
+ QTest::newRow("empty") << "" << "application/octet-stream";
}
static inline QByteArray msgMimeTypeForFileNameFailed(const QList<QMimeType> &actual,