Skip to content

Commit

Permalink
Merge pull request #1335 from manisandro/apply_settings_when_saving_s…
Browse files Browse the repository at this point in the history
…tyle

Apply settings before saving style, otherwise unapplied settings are not written to qml file
  • Loading branch information
blazek committed May 14, 2014
2 parents 9804d17 + 42203b7 commit 25d991c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -1622,6 +1622,9 @@ void QgsRasterLayerProperties::on_pbnLoadDefaultStyle_clicked()


void QgsRasterLayerProperties::on_pbnSaveDefaultStyle_clicked() void QgsRasterLayerProperties::on_pbnSaveDefaultStyle_clicked()
{ {

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

// a flag passed by reference // a flag passed by reference
bool defaultSavedFlag = false; bool defaultSavedFlag = false;
// after calling this the above flag will be set true for success // 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 ) ) if ( !outputFileName.endsWith( ".qml", Qt::CaseInsensitive ) )
outputFileName += ".qml"; outputFileName += ".qml";


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

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

0 comments on commit 25d991c

Please sign in to comment.