Mimetypes v3: Fix that octet-stream was wrongly considered parent

The fallback mimetype of application/octet-stream is supposed to only be
a fallback if the mimetype doesn't specify another parent.

Amends 98b1e82d2b

Fixes: QTCREATORBUG-27398
Change-Id: I4ac92dd4817fae37de4499fe9e08aa2e5dd50a51
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
Eike Ziller
2022-04-26 11:42:43 +02:00
parent 1a3cb067b8
commit 1b5b4cb6f4

View File

@@ -356,9 +356,11 @@ QStringList MimeDatabasePrivate::parents(const QString &mimeName)
break; break;
} }
} }
if (result.isEmpty()) {
const QString parent = fallbackParent(mimeName); const QString parent = fallbackParent(mimeName);
if (!parent.isEmpty()) if (!parent.isEmpty())
result.append(parent); result.append(parent);
}
return result; return result;
} }