bool QnxToolChainConfigWidget::isDirtyImpl() const
{
    QnxToolChain *tc = static_cast<QnxToolChain *>(toolChain());
    Q_ASSERT(tc);
    return m_compilerCommand->fileName() != tc->compilerCommand()
            || m_ndkPath->path() != tc->ndkPath()
            || m_abiWidget->currentAbi() != tc->targetAbi();
}
ToolChain *QnxToolChainFactory::restore(const QVariantMap &data)
{
    QnxToolChain *tc = new QnxToolChain(ToolChain::ManualDetection);
    if (tc->fromMap(data))
        return tc;

    delete tc;
    return 0;
}
void QnxToolChainConfigWidget::discardImpl()
{
    // subwidgets are not yet connected!
    bool blocked = blockSignals(true);
    QnxToolChain *tc = static_cast<QnxToolChain *>(toolChain());
    m_compilerCommand->setFileName(tc->compilerCommand());
    m_ndkPath->setPath(tc->ndkPath());
    m_abiWidget->setAbis(tc->supportedAbis(), tc->targetAbi());
    if (!m_compilerCommand->path().isEmpty())
        m_abiWidget->setEnabled(true);
    blockSignals(blocked);
}
QnxToolChain *BlackBerryConfiguration::createToolChain(
        ProjectExplorer::Abi abi, const QString &versionName)
{
    QnxToolChain* toolChain = new QnxToolChain(ToolChain::AutoDetection);
    toolChain->setDisplayName(tr("QCC for %1").arg(versionName));
    toolChain->setCompilerCommand(m_gccCompiler);
    toolChain->setNdkPath(ndkPath());
    if (abi.isValid())
        toolChain->setTargetAbi(abi);
    ToolChainManager::registerToolChain(toolChain);
    return toolChain;
}
void QnxToolChainConfigWidget::applyImpl()
{
    if (toolChain()->isAutoDetected())
        return;

    QnxToolChain *tc = static_cast<QnxToolChain *>(toolChain());
    Q_ASSERT(tc);
    QString displayName = tc->displayName();
    tc->resetToolChain(m_compilerCommand->fileName());
    tc->setDisplayName(displayName); // reset display name
    tc->setNdkPath(m_ndkPath->fileName().toString());
    tc->setTargetAbi(m_abiWidget->currentAbi());
}