bool GoProject::fromMap(const QVariantMap &map) { if (!Project::fromMap(map)) return false; // refresh first - project information is used e.g. to decide the default RC's refresh(Everything); // addedTarget calls updateEnabled on the runconfigurations // which needs to happen after refresh foreach (Target *t, targets()) addedTarget(t); connect(this, SIGNAL(addedTarget(ProjectExplorer::Target*)), this, SLOT(addedTarget(ProjectExplorer::Target*))); connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)), this, SLOT(onActiveTargetChanged(ProjectExplorer::Target*))); // make sure we get updates on kit changes m_activeTarget = activeTarget(); if (m_activeTarget) connect(m_activeTarget, SIGNAL(kitChanged()), this, SLOT(onKitChanged())); return true; }
void QmlProject::refresh(RefreshOptions options) { parseProject(options); if (options & Files) m_rootNode->refresh(); QmlJS::ModelManagerInterface::ProjectInfo pinfo(this); pinfo.sourceFiles = files(); pinfo.importPaths = importPaths(); QtSupport::BaseQtVersion *version = 0; if (activeTarget()) { if (QmlProjectRunConfiguration *rc = qobject_cast<QmlProjectRunConfiguration *>(activeTarget()->activeRunConfiguration())) version = rc->qtVersion(); QList<ProjectExplorer::ToolChain *> tcList; if (version && !version->qtAbis().isEmpty()) tcList = ProjectExplorer::ToolChainManager::instance()->findToolChains(version->qtAbis().at(0)); if (!tcList.isEmpty()) QtSupport::QmlDumpTool::pathAndEnvironment(this, version, tcList.first(), false, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment); } if (version) { pinfo.tryQmlDump = true; pinfo.qtImportsPath = version->versionInfo().value("QT_INSTALL_IMPORTS"); pinfo.qtVersionString = version->qtVersionString(); } m_modelManager->updateProjectInfo(pinfo); }
void QmlProject::refresh(RefreshOptions options) { parseProject(options); if (options & Files) m_rootNode->refresh(); QmlJS::ModelManagerInterface::ProjectInfo pinfo(this); pinfo.sourceFiles = files(); pinfo.importPaths = customImportPaths(); QtSupport::BaseQtVersion *version = 0; if (activeTarget()) { ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(activeTarget()->kit()); version = QtSupport::QtKitInformation::qtVersion(activeTarget()->kit()); QtSupport::QmlDumpTool::pathAndEnvironment(this, version, tc, false, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment); } if (version) { pinfo.tryQmlDump = true; pinfo.qtImportsPath = version->qmakeProperty("QT_INSTALL_IMPORTS"); pinfo.qtQmlPath = version->qmakeProperty("QT_INSTALL_QML"); pinfo.qtVersionString = version->qtVersionString(); } m_modelManager->updateProjectInfo(pinfo); }
void QmlProject::refresh(RefreshOptions options) { parseProject(options); if (options & Files) m_rootNode->refresh(); QmlJS::ModelManagerInterface::ProjectInfo pinfo(this); pinfo.sourceFiles = files(); pinfo.importPaths = importPaths(); QtSupport::BaseQtVersion *version = 0; if (activeTarget()) { if (QmlProjectRunConfiguration *rc = qobject_cast<QmlProjectRunConfiguration *>(activeTarget()->activeRunConfiguration())) version = rc->qtVersion(); QtSupport::QmlDumpTool::pathAndEnvironment(this, version, false, &pinfo.qmlDumpPath, &pinfo.qmlDumpEnvironment); } m_modelManager->updateProjectInfo(pinfo); }
void Project::changeBuildConfigurationEnabled() { Target *t = qobject_cast<Target *>(sender()); if (t == activeTarget()) emit buildConfigurationEnabledChanged(); }
void Project::changeEnvironment() { Target *t = qobject_cast<Target *>(sender()); if (t == activeTarget()) emit environmentChanged(); }
bool Project::hasActiveBuildSettings() const { return activeTarget() && IBuildConfigurationFactory::find(activeTarget()); }