Skip to content
Permalink
Browse files

Apply settings before saving style, otherwise unapplied settings are …

…not written to qml file
  • Loading branch information
manisandro committed May 6, 2014
1 parent 4efa70d commit 42203b775ea0163ddd2b027460cdaf82f9ae782c
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 42203b7

Please sign in to comment.
You can’t perform that action at this time.