Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1335 from manisandro/apply_settings_when_saving_s…
…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()
{

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 25d991c

Please sign in to comment.