Skip to content

Commit

Permalink
Apply settings before saving style, otherwise unapplied settings are …
Browse files Browse the repository at this point in the history
…not written to qml file
  • Loading branch information
manisandro committed May 6, 2014
1 parent 4efa70d commit 42203b7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/qgsrasterlayerproperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1622,6 +1622,9 @@ void QgsRasterLayerProperties::on_pbnLoadDefaultStyle_clicked()

void QgsRasterLayerProperties::on_pbnSaveDefaultStyle_clicked()
{

apply(); // make sure the style to save is uptodate

// a flag passed by reference
bool defaultSavedFlag = false;
// after calling this the above flag will be set true for success
Expand Down Expand Up @@ -1691,6 +1694,8 @@ void QgsRasterLayerProperties::on_pbnSaveStyleAs_clicked()
if ( !outputFileName.endsWith( ".qml", Qt::CaseInsensitive ) )
outputFileName += ".qml";

apply(); // make sure the style to save is uptodate

bool defaultLoadedFlag = false;
QString message = mRasterLayer->saveNamedStyle( outputFileName, defaultLoadedFlag );
if ( defaultLoadedFlag )
Expand Down

0 comments on commit 42203b7

Please sign in to comment.