forked from qt-creator/qt-creator
Mimetypes v3: Reimplement MimeType matchesName
This makes Qt Creator set the right default editor again. Visible in the MIME Types setting, before this change everything is opened in the text editor. Change-Id: I88ffc2e41688c2395925821e1d5d8ffee0d127eb Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -521,10 +521,11 @@ bool MimeType::inherits(const QString &mimeTypeName) const
|
|||||||
*/
|
*/
|
||||||
bool MimeType::matchesName(const QString &nameOrAlias) const
|
bool MimeType::matchesName(const QString &nameOrAlias) const
|
||||||
{
|
{
|
||||||
// if (d->name == nameOrAlias)
|
if (d->name == nameOrAlias)
|
||||||
// return true;
|
|
||||||
// return MimeDatabasePrivate::instance()->provider()->resolveAlias(nameOrAlias) == d->name;
|
|
||||||
return true;
|
return true;
|
||||||
|
auto dbp = MimeDatabasePrivate::instance();
|
||||||
|
QMutexLocker locker(&dbp->mutex);
|
||||||
|
return MimeDatabasePrivate::instance()->resolveAlias(nameOrAlias) == d->name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Reference in New Issue
Block a user