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

@@ -406,8 +406,7 @@ bool ClangCompletionAssistProcessor::completeInclude(const QTextCursor &cursor)
if (!headerPaths.contains(currentFilePath))
headerPaths.append(currentFilePath);
::Utils::MimeDatabase mdb;
const ::Utils::MimeType mimeType = mdb.mimeTypeForName(QLatin1String("text/x-c++hdr"));
const ::Utils::MimeType mimeType = ::Utils::mimeTypeForName("text/x-c++hdr");
const QStringList suffixes = mimeType.suffixes();
foreach (const CppTools::ProjectPartHeaderPath &headerPath, headerPaths) {