@@ -154,7 +154,7 @@ void QgsVectorLayerProperties::setDisplayField(QString name)
154154 displayFieldComboBox->setCurrentText (name);
155155}
156156
157- // ! @note in raster props, this metho d is called sync()
157+ // ! @note in raster props, this method is called sync()
158158void QgsVectorLayerProperties::reset ( void )
159159{
160160 // populate the general information
@@ -639,6 +639,8 @@ void QgsVectorLayerProperties::on_pbnLoadDefaultStyle_clicked()
639639
640640void QgsVectorLayerProperties::on_pbnSaveDefaultStyle_clicked ()
641641{
642+ apply (); // make sure the qml to save is uptodate
643+
642644 // a flag passed by reference
643645 bool defaultSavedFlag = false ;
644646 // after calling this the above flag will be set true for success
@@ -685,7 +687,7 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
685687 if ( myFileDialog->selectedFilter () == tr ( " QGIS Layer Style File (*.qml)" ) )
686688 {
687689 // ensure the user never ommitted the extension from the filename
688- if ( !myFileName.toUpper (). endsWith ( " .QML " ) )
690+ if ( !myFileName.endsWith ( " .qml " , Qt::CaseInsensitive ) )
689691 {
690692 myFileName += " .qml" ;
691693 }
@@ -714,7 +716,6 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
714716
715717void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked ()
716718{
717-
718719 QSettings myQSettings; // where we keep last used filter in persistant state
719720 QString myLastUsedDir = myQSettings.value ( " style/lastStyleDir" , " ." ).toString ();
720721
@@ -746,11 +747,14 @@ void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked()
746747 {
747748 if ( myFileDialog->selectedFilter () == tr ( " QGIS Layer Style File (*.qml)" ) )
748749 {
750+ apply (); // make sure the qml to save is uptodate
751+
749752 // ensure the user never ommitted the extension from the filename
750- if ( !myOutputFileName.toUpper (). endsWith ( " .QML " ) )
753+ if ( !myOutputFileName.endsWith ( " .qml " , Qt::CaseInsensitive ) )
751754 {
752755 myOutputFileName += " .qml" ;
753756 }
757+
754758 bool defaultLoadedFlag = false ;
755759 QString myMessage = layer->saveNamedStyle ( myOutputFileName, defaultLoadedFlag );
756760 // reset if the default style was loaded ok only
0 commit comments