Example #1
0
bool Target::removeBuildConfiguration(BuildConfiguration *bc)
{
    //todo: this might be error prone
    if (!d->m_buildConfigurations.contains(bc))
        return false;

    if (BuildManager::isBuilding(bc))
        return false;

    d->m_buildConfigurations.removeOne(bc);
    emit aboutToRemoveProjectConfiguration(bc);
    d->m_buildConfigurations.removeOne(bc);


    if (activeBuildConfiguration() == bc) {
        if (d->m_buildConfigurations.isEmpty())
            SessionManager::setActiveBuildConfiguration(this, nullptr, SetActive::Cascade);
        else
            SessionManager::setActiveBuildConfiguration(this, d->m_buildConfigurations.at(0), SetActive::Cascade);
    }

    emit removedBuildConfiguration(bc);
    emit removedProjectConfiguration(bc);

    delete bc;
    return true;
}
Utils::AbstractMacroExpander *LocalApplicationRunConfiguration::macroExpander() const
{
    if (BuildConfiguration *bc = activeBuildConfiguration())
        return bc->macroExpander();

    static Internal::VarManMacroExpander mx;
    return &mx;
}
Utils::AbstractMacroExpander *LocalApplicationRunConfiguration::macroExpander() const
{
    if (BuildConfiguration *bc = activeBuildConfiguration())
        return bc->macroExpander();
    if (!m_macroExpander)
        m_macroExpander = new Internal::FallBackMacroExpander(target());
    return m_macroExpander;
}
Example #4
0
void Target::onBuildDirectoryChanged()
{
    BuildConfiguration *bc = qobject_cast<BuildConfiguration *>(sender());
    if (bc && activeBuildConfiguration() == bc)
        emit buildDirectoryChanged();
}
Example #5
0
void Target::changeBuildConfigurationEnabled()
{
    BuildConfiguration *bc = qobject_cast<BuildConfiguration *>(sender());
    if (bc == activeBuildConfiguration())
        emit buildConfigurationEnabledChanged();
}