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:
hjk
2017-03-02 12:07:11 +01:00
parent 2cd8378148
commit 3f5caf4cdc
51 changed files with 238 additions and 245 deletions

View File

@@ -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,