|
|
|
@ -94,26 +94,34 @@ Config::ApplyPresets::apply( const char* fieldName )
|
|
|
|
|
if ( !prop.isValid() )
|
|
|
|
|
{
|
|
|
|
|
cWarning() << "Applying invalid property" << fieldName;
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
|
|
|
|
|
const QString key( fieldName );
|
|
|
|
|
if ( key.isEmpty() )
|
|
|
|
|
{
|
|
|
|
|
const QString key( fieldName );
|
|
|
|
|
if ( !key.isEmpty() && m_c.d->m_presets->find( key ).isValid() )
|
|
|
|
|
{
|
|
|
|
|
cWarning() << "Applying duplicate property" << fieldName;
|
|
|
|
|
}
|
|
|
|
|
else if ( !key.isEmpty() && m_map.contains( key ) )
|
|
|
|
|
{
|
|
|
|
|
QVariantMap m = CalamaresUtils::getSubMap( m_map, key, m_bogus );
|
|
|
|
|
QVariant value = m[ "value" ];
|
|
|
|
|
bool editable = CalamaresUtils::getBool( m, "editable", true );
|
|
|
|
|
cWarning() << "Applying empty field";
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( value.isValid() )
|
|
|
|
|
{
|
|
|
|
|
m_c.setProperty( fieldName, value );
|
|
|
|
|
}
|
|
|
|
|
m_c.d->m_presets->append( PresetField { key, value, editable } );
|
|
|
|
|
if ( m_c.d->m_presets->find( key ).isValid() )
|
|
|
|
|
{
|
|
|
|
|
cWarning() << "Applying duplicate property" << fieldName;
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( m_map.contains( key ) )
|
|
|
|
|
{
|
|
|
|
|
// Key has an explicit setting
|
|
|
|
|
QVariantMap m = CalamaresUtils::getSubMap( m_map, key, m_bogus );
|
|
|
|
|
QVariant value = m[ "value" ];
|
|
|
|
|
bool editable = CalamaresUtils::getBool( m, "editable", true );
|
|
|
|
|
|
|
|
|
|
if ( value.isValid() )
|
|
|
|
|
{
|
|
|
|
|
m_c.setProperty( fieldName, value );
|
|
|
|
|
}
|
|
|
|
|
m_c.d->m_presets->append( PresetField { key, value, editable } );
|
|
|
|
|
}
|
|
|
|
|
return *this;
|
|
|
|
|
}
|
|
|
|
|