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:
@@ -230,8 +230,7 @@ void CppEditorDocument::onFilePathChanged(const Utils::FileName &oldPath,
|
||||
Q_UNUSED(oldPath);
|
||||
|
||||
if (!newPath.isEmpty()) {
|
||||
Utils::MimeDatabase mdb;
|
||||
setMimeType(mdb.mimeTypeForFile(newPath.toFileInfo()).name());
|
||||
setMimeType(Utils::mimeTypeForFile(newPath.toFileInfo()).name());
|
||||
|
||||
connect(this, &Core::IDocument::contentsChanged,
|
||||
this, &CppEditorDocument::scheduleProcessDocument,
|
||||
|
||||
Reference in New Issue
Block a user