forked from qt-creator/qt-creator
Use new mime database
Change-Id: I4305872b6b11ef3e8a364280ffa5209a5a793600 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -37,7 +37,6 @@
|
||||
|
||||
#include <coreplugin/documentmanager.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/kit.h>
|
||||
@@ -45,6 +44,7 @@
|
||||
#include <projectexplorer/projectmacroexpander.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QInputDialog>
|
||||
@@ -161,8 +161,10 @@ QList<ProjectExplorer::BuildInfo *> CMakeBuildConfigurationFactory::availableBui
|
||||
|
||||
int CMakeBuildConfigurationFactory::priority(const ProjectExplorer::Kit *k, const QString &projectPath) const
|
||||
{
|
||||
return (k && Core::MimeDatabase::findByFile(QFileInfo(projectPath))
|
||||
.matchesType(QLatin1String(Constants::CMAKEPROJECTMIMETYPE))) ? 0 : -1;
|
||||
Utils::MimeDatabase mdb;
|
||||
if (k && mdb.mimeTypeForFile(projectPath).matchesName(QLatin1String(Constants::CMAKEPROJECTMIMETYPE)))
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::BuildInfo *> CMakeBuildConfigurationFactory::availableSetups(const ProjectExplorer::Kit *k,
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "cmakesettingspage.h"
|
||||
|
||||
#include <coreplugin/featureprovider.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
|
||||
#include <QtPlugin>
|
||||
#include <QDebug>
|
||||
@@ -59,8 +59,8 @@ CMakeProjectPlugin::~CMakeProjectPlugin()
|
||||
|
||||
bool CMakeProjectPlugin::initialize(const QStringList & /*arguments*/, QString *errorMessage)
|
||||
{
|
||||
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":cmakeproject/CMakeProjectManager.mimetypes.xml"), errorMessage))
|
||||
return false;
|
||||
Q_UNUSED(errorMessage)
|
||||
Utils::MimeDatabase::addMimeTypes(QLatin1String(":cmakeproject/CMakeProjectManager.mimetypes.xml"));
|
||||
|
||||
CMakeSettingsPage *cmp = new CMakeSettingsPage();
|
||||
addAutoReleasedObject(cmp);
|
||||
|
||||
Reference in New Issue
Block a user