Followup 08ee180: more appropriate ramp type property name

This commit is contained in:
nirvn 2016-12-05 08:47:35 +07:00
parent dc697d0590
commit c8266a2512
3 changed files with 8 additions and 8 deletions

View File

@ -176,7 +176,7 @@ void QgsGlowEffect::readProperties( const QgsStringMap &props )
//attempt to create color ramp from props //attempt to create color ramp from props
delete mRamp; delete mRamp;
if ( props.contains( QStringLiteral( "gradientType" ) ) && props[QStringLiteral( "gradientType" )] == QStringLiteral( "cpt-city" ) ) if ( props.contains( QStringLiteral( "rampType" ) ) && props[QStringLiteral( "rampType" )] == QStringLiteral( "cpt-city" ) )
{ {
mRamp = QgsCptCityColorRamp::create( props ); mRamp = QgsCptCityColorRamp::create( props );
} }

View File

@ -218,7 +218,7 @@ QgsStringMap QgsGradientColorRamp::properties() const
map["info_" + it.key()] = it.value(); map["info_" + it.key()] = it.value();
} }
map[QStringLiteral( "gradientType" )] = type(); map[QStringLiteral( "rampType" )] = type();
return map; return map;
} }
void QgsGradientColorRamp::convertToDiscrete( bool discrete ) void QgsGradientColorRamp::convertToDiscrete( bool discrete )
@ -368,7 +368,7 @@ QgsStringMap QgsLimitedRandomColorRamp::properties() const
map[QStringLiteral( "satMax" )] = QString::number( mSatMax ); map[QStringLiteral( "satMax" )] = QString::number( mSatMax );
map[QStringLiteral( "valMin" )] = QString::number( mValMin ); map[QStringLiteral( "valMin" )] = QString::number( mValMin );
map[QStringLiteral( "valMax" )] = QString::number( mValMax ); map[QStringLiteral( "valMax" )] = QString::number( mValMax );
map[QStringLiteral( "gradientType" )] = type(); map[QStringLiteral( "rampType" )] = type();
return map; return map;
} }
@ -586,7 +586,7 @@ QgsStringMap QgsColorBrewerColorRamp::properties() const
map[QStringLiteral( "schemeName" )] = mSchemeName; map[QStringLiteral( "schemeName" )] = mSchemeName;
map[QStringLiteral( "colors" )] = QString::number( mColors ); map[QStringLiteral( "colors" )] = QString::number( mColors );
map[QStringLiteral( "inverted" )] = QString::number( mInverted ); map[QStringLiteral( "inverted" )] = QString::number( mInverted );
map[QStringLiteral( "gradientType" )] = type(); map[QStringLiteral( "rampType" )] = type();
return map; return map;
} }
@ -675,7 +675,7 @@ QgsStringMap QgsCptCityColorRamp::properties() const
QgsStringMap map; QgsStringMap map;
map[QStringLiteral( "schemeName" )] = mSchemeName; map[QStringLiteral( "schemeName" )] = mSchemeName;
map[QStringLiteral( "variantName" )] = mVariantName; map[QStringLiteral( "variantName" )] = mVariantName;
map[QStringLiteral( "gradientType" )] = type(); map[QStringLiteral( "rampType" )] = type();
return map; return map;
} }
@ -890,7 +890,7 @@ QgsStringMap QgsPresetSchemeColorRamp::properties() const
props.insert( QStringLiteral( "preset_color_%1" ).arg( i ), QgsSymbolLayerUtils::encodeColor( mColors.at( i ).first ) ); props.insert( QStringLiteral( "preset_color_%1" ).arg( i ), QgsSymbolLayerUtils::encodeColor( mColors.at( i ).first ) );
props.insert( QStringLiteral( "preset_color_name_%1" ).arg( i ), mColors.at( i ).second ); props.insert( QStringLiteral( "preset_color_name_%1" ).arg( i ), mColors.at( i ).second );
} }
props[QStringLiteral( "gradientType" )] = type(); props[QStringLiteral( "rampType" )] = type();
return props; return props;
} }

View File

@ -539,7 +539,7 @@ QgsSymbolLayer* QgsGradientFillSymbolLayer::create( const QgsStringMap& props )
//attempt to create color ramp from props //attempt to create color ramp from props
QgsColorRamp* gradientRamp; QgsColorRamp* gradientRamp;
if ( props.contains( QStringLiteral( "gradientType" ) ) && props[QStringLiteral( "gradientType" )] == QStringLiteral( "cpt-city" ) ) if ( props.contains( QStringLiteral( "rampType" ) ) && props[QStringLiteral( "rampType" )] == QStringLiteral( "cpt-city" ) )
{ {
gradientRamp = QgsCptCityColorRamp::create( props ); gradientRamp = QgsCptCityColorRamp::create( props );
} }
@ -1027,7 +1027,7 @@ QgsSymbolLayer* QgsShapeburstFillSymbolLayer::create( const QgsStringMap& props
//attempt to create color ramp from props //attempt to create color ramp from props
QgsColorRamp* gradientRamp; QgsColorRamp* gradientRamp;
if ( props.contains( QStringLiteral( "gradientType" ) ) && props["gradientType"] == QStringLiteral( "cpt-city" ) ) if ( props.contains( QStringLiteral( "rampType" ) ) && props["rampType"] == QStringLiteral( "cpt-city" ) )
{ {
gradientRamp = QgsCptCityColorRamp::create( props ); gradientRamp = QgsCptCityColorRamp::create( props );
} }