Skip to content
Permalink
Browse files
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 25d991c73f0872997588fac56fe367826c9019db
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/app/qgsrasterlayerproperties.cpp
@@ -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
@@ -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 )

0 comments on commit 25d991c

Please sign in to comment.