Commit 17539d67 authored by Kai Koehne's avatar Kai Koehne

Revert "Project: Set QML/C++ languages where both are possible"

This reverts commit 75691393. Otherwise
we'd enable QML debugging for virtually all projects.

Change-Id: I5518624a9973a9f61fbef6c680b5a83c74d0b4a9
Reviewed-by: default avatarAurindam Jana <aurindam.jana@digia.com>
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 16c2c96c
......@@ -79,9 +79,7 @@ AutotoolsProject::AutotoolsProject(AutotoolsManager *manager, const QString &fil
m_makefileParserThread(0)
{
setProjectContext(Core::Context(Constants::PROJECT_CONTEXT));
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
const QFileInfo fileInfo(m_fileName);
m_projectName = fileInfo.absoluteDir().dirName();
......
......@@ -109,10 +109,7 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName)
m_lastEditor(0)
{
setProjectContext(Core::Context(CMakeProjectManager::Constants::PROJECTCONTEXT));
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
m_file = new CMakeFile(this, fileName);
......
......@@ -70,10 +70,7 @@ GenericProject::GenericProject(Manager *manager, const QString &fileName)
m_fileName(fileName)
{
setProjectContext(Context(GenericProjectManager::Constants::PROJECTCONTEXT));
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
QFileInfo fileInfo(m_fileName);
QDir dir = fileInfo.dir();
......
......@@ -106,10 +106,7 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
m_currentBc(0)
{
setProjectContext(Core::Context(Constants::PROJECT_ID));
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
this, SLOT(changeActiveTarget(ProjectExplorer::Target*)));
......
......@@ -109,7 +109,7 @@ QmlProject::QmlProject(Internal::Manager *manager, const QString &fileName)
m_modelManager(QmlJS::ModelManagerInterface::instance())
{
setProjectContext(Core::Context(QmlProjectManager::Constants::PROJECTCONTEXT));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_QMLJS));
setProjectLanguages(Core::Context(QmlProjectManager::Constants::LANG_QML));
QFileInfo fileInfo(m_fileName);
m_projectName = fileInfo.completeBaseName();
......
......@@ -36,6 +36,7 @@ namespace QmlProjectManager {
namespace Constants {
const char *const PROJECTCONTEXT = "QmlProject.ProjectContext";
const char *const LANG_QML = "QML";
const char *const QMLPROJECT_MIMETYPE = QmlJSTools::Constants::QMLPROJECT_MIMETYPE;
} // namespace Constants
......
......@@ -353,9 +353,7 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) :
m_activeTarget(0)
{
setProjectContext(Core::Context(Qt4ProjectManager::Constants::PROJECT_ID));
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
m_asyncUpdateTimer.setSingleShot(true);
m_asyncUpdateTimer.setInterval(3000);
......@@ -637,6 +635,15 @@ void Qt4Project::updateQmlJSCodeModel()
}
}
// If the project directory has a pro/pri file that includes a qml or quick or declarative
// library then chances of the project being a QML project is quite high.
// This assumption fails when there are no QDeclarativeEngine/QDeclarativeView (QtQuick 1)
// or QQmlEngine/QQuickView (QtQuick 2) instances.
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
if (hasQmlLib)
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
projectInfo.importPaths.removeDuplicates();
setProjectLanguage(ProjectExplorer::Constants::LANG_QMLJS, !projectInfo.sourceFiles.isEmpty());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment