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:
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
|
||||
<mime-type type="text/x-makefile">
|
||||
<sub-class-of type="text/plain"/>
|
||||
<comment>Automake based Makefile</comment>
|
||||
<glob weight="10" pattern="Makefile.am"/>
|
||||
</mime-type>
|
||||
</mime-info>
|
||||
@@ -40,7 +40,6 @@
|
||||
#include "configurestep.h"
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
#include <projectexplorer/buildinfo.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/kitinformation.h>
|
||||
@@ -48,6 +47,7 @@
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/toolchain.h>
|
||||
#include <qtsupport/customexecutablerunconfiguration.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
@@ -104,8 +104,10 @@ QList<BuildInfo *> AutotoolsBuildConfigurationFactory::availableBuilds(const Tar
|
||||
|
||||
int AutotoolsBuildConfigurationFactory::priority(const Kit *k, const QString &projectPath) const
|
||||
{
|
||||
return (k && Core::MimeDatabase::findByFile(QFileInfo(projectPath))
|
||||
.matchesType(QLatin1String(Constants::MAKEFILE_MIMETYPE))) ? 0 : -1;
|
||||
Utils::MimeDatabase mdb;
|
||||
if (k && mdb.mimeTypeForFile(projectPath).matchesName(QLatin1String(Constants::MAKEFILE_MIMETYPE)))
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
QList<BuildInfo *> AutotoolsBuildConfigurationFactory::availableSetups(const Kit *k, const QString &projectPath) const
|
||||
|
||||
@@ -29,4 +29,3 @@ SOURCES = autotoolsprojectplugin.cpp\
|
||||
configurestep.cpp\
|
||||
makefileparserthread.cpp\
|
||||
makefileparser.cpp
|
||||
RESOURCES += autotoolsproject.qrc
|
||||
|
||||
@@ -39,8 +39,6 @@
|
||||
#include "configurestep.h"
|
||||
#include "autotoolsprojectconstants.h"
|
||||
|
||||
#include <coreplugin/mimedatabase.h>
|
||||
|
||||
#include <QStringList>
|
||||
#include <QtPlugin>
|
||||
|
||||
@@ -57,10 +55,8 @@ void AutotoolsProjectPlugin::extensionsInitialized()
|
||||
bool AutotoolsProjectPlugin::initialize(const QStringList &arguments,
|
||||
QString *errorString)
|
||||
{
|
||||
Q_UNUSED(arguments);
|
||||
|
||||
if (!Core::MimeDatabase::addMimeTypes(QLatin1String(":autotoolsproject/AutotoolsProjectManager.mimetypes.xml"), errorString))
|
||||
return false;
|
||||
Q_UNUSED(arguments)
|
||||
Q_UNUSED(errorString)
|
||||
|
||||
addAutoReleasedObject(new AutotoolsBuildConfigurationFactory);
|
||||
addAutoReleasedObject(new MakeStepFactory);
|
||||
|
||||
Reference in New Issue
Block a user