forked from qt-creator/qt-creator
Utils: Wrap MimeDatabase into static functions
To avoid repeating the 'MimeDatabase mdb; mdb.something(); ' mantra all over the place. Change-Id: I4bfef62e73275a991455141671d6071162788e9d Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -614,8 +614,7 @@ Core::IDocument::OpenResult TextDocument::open(QString *errorString, const QStri
|
||||
emit aboutToOpen(fileName, realFileName);
|
||||
OpenResult success = openImpl(errorString, fileName, realFileName, /*reload =*/ false);
|
||||
if (success == OpenResult::Success) {
|
||||
Utils::MimeDatabase mdb;
|
||||
setMimeType(mdb.mimeTypeForFile(fileName).name());
|
||||
setMimeType(Utils::mimeTypeForFile(fileName).name());
|
||||
emit openFinishedSuccessfully();
|
||||
}
|
||||
return success;
|
||||
|
||||
Reference in New Issue
Block a user