void AStylePreferences::load(const KDevelop::SourceFormatterStyle &style)
{
    if(!style.content().isEmpty())
        m_formatter->loadStyle(style.content());
    else
        m_formatter->predefinedStyle(style.name());

    updateWidgets();
    updatePreviewText();
}
Ejemplo n.º 2
0
void FormatterPreferences::load(const KDevelop::SourceFormatterStyle& style)
{
    spacingSbx->blockSignals(true);
    caseCbx->blockSignals(true);
    
    m_formatter->loadStyle ( style.content() );
    int indent = getOptions()["INDENT"].toInt();
    if ( indent < 0 || indent > 99 )
      indent = 4;
    spacingSbx->setValue(indent);
    if(getOptions()["CASE"].toString() == "LOWER")
        caseCbx->setCurrentIndex(1);
    else if(getOptions()["CASE"].toString() == "UPPER")
        caseCbx->setCurrentIndex(2);
    else
        caseCbx->setCurrentIndex(0);

    spacingSbx->blockSignals(false);
    caseCbx->blockSignals(false);
}