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;
}
Exemplo n.º 2
0
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);
}
Exemplo n.º 3
0
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);
}
Exemplo n.º 4
0
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);
}
Exemplo n.º 5
0
void Project::changeBuildConfigurationEnabled()
{
    Target *t = qobject_cast<Target *>(sender());
    if (t == activeTarget())
        emit buildConfigurationEnabledChanged();
}
Exemplo n.º 6
0
void Project::changeEnvironment()
{
    Target *t = qobject_cast<Target *>(sender());
    if (t == activeTarget())
        emit environmentChanged();
}
Exemplo n.º 7
0
bool Project::hasActiveBuildSettings() const
{
    return activeTarget() && IBuildConfigurationFactory::find(activeTarget());
}