Apply 'static' pattern to MimeDatabase

Also adjust and streamline using and surrounding code.

Change-Id: I6a8b05126bdcbb74ff611b21c7cb3c5902a2d5ca
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
hjk
2013-08-30 16:38:57 +02:00
committed by Tobias Hunger
parent 1226400af3
commit a37589d431
57 changed files with 362 additions and 466 deletions

View File

@@ -1155,7 +1155,7 @@ bool CppCompletionAssistProcessor::completeInclude(const QTextCursor &cursor)
includePaths.append(currentFilePath);
const Core::MimeType mimeType =
Core::ICore::mimeDatabase()->findByType(QLatin1String("text/x-c++hdr"));
Core::MimeDatabase::findByType(QLatin1String("text/x-c++hdr"));
const QStringList suffixes = mimeType.suffixes();
foreach (const QString &includePath, includePaths) {
@@ -1213,8 +1213,7 @@ bool CppCompletionAssistProcessor::objcKeywordsWanted() const
const QString fileName = m_interface->fileName();
const Core::MimeDatabase *mdb = Core::ICore::mimeDatabase();
const QString mt = mdb->findByFile(fileName).type();
const QString mt = Core::MimeDatabase::findByFile(fileName).type();
return mt == QLatin1String(CppTools::Constants::OBJECTIVE_C_SOURCE_MIMETYPE)
|| mt == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE);
}