Commit 75691393 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

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



Change-Id: I4bc5bd7a644c48dfa529f9f9f6052e401de76d40
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent ace68297
......@@ -79,7 +79,9 @@ AutotoolsProject::AutotoolsProject(AutotoolsManager *manager, const QString &fil
m_makefileParserThread(0)
{
setProjectContext(Core::Context(Constants::PROJECT_CONTEXT));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
const QFileInfo fileInfo(m_fileName);
m_projectName = fileInfo.absoluteDir().dirName();
......
......@@ -109,7 +109,10 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName)
m_lastEditor(0)
{
setProjectContext(Core::Context(CMakeProjectManager::Constants::PROJECTCONTEXT));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
m_file = new CMakeFile(this, fileName);
......
......@@ -70,7 +70,10 @@ GenericProject::GenericProject(Manager *manager, const QString &fileName)
m_fileName(fileName)
{
setProjectContext(Context(GenericProjectManager::Constants::PROJECTCONTEXT));
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
QFileInfo fileInfo(m_fileName);
QDir dir = fileInfo.dir();
......
......@@ -103,7 +103,10 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
m_currentBc(0)
{
setProjectContext(Core::Context(Constants::PROJECT_ID));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
this, SLOT(changeActiveTarget(ProjectExplorer::Target*)));
......
......@@ -117,7 +117,7 @@ QmlProject::QmlProject(Internal::Manager *manager, const QString &fileName)
m_modelManager(QmlJS::ModelManagerInterface::instance())
{
setProjectContext(Core::Context(QmlProjectManager::Constants::PROJECTCONTEXT));
setProjectLanguages(Core::Context(QmlProjectManager::Constants::LANG_QML));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_QMLJS));
QFileInfo fileInfo(m_fileName);
m_projectName = fileInfo.completeBaseName();
......
......@@ -36,7 +36,6 @@ 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
......
......@@ -328,7 +328,9 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) :
m_activeTarget(0)
{
setProjectContext(Core::Context(Qt4ProjectManager::Constants::PROJECT_ID));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
Core::Context pl(ProjectExplorer::Constants::LANG_CXX);
pl.add(ProjectExplorer::Constants::LANG_QMLJS);
setProjectLanguages(pl);
m_asyncUpdateTimer.setSingleShot(true);
m_asyncUpdateTimer.setInterval(3000);
......@@ -609,15 +611,6 @@ 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();
modelManager->updateProjectInfo(projectInfo);
......
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