@@ -154,7 +154,7 @@ void QgsVectorLayerProperties::setDisplayField(QString name)
154
154
displayFieldComboBox->setCurrentText (name);
155
155
}
156
156
157
- // ! @note in raster props, this metho d is called sync()
157
+ // ! @note in raster props, this method is called sync()
158
158
void QgsVectorLayerProperties::reset ( void )
159
159
{
160
160
// populate the general information
@@ -639,6 +639,8 @@ void QgsVectorLayerProperties::on_pbnLoadDefaultStyle_clicked()
639
639
640
640
void QgsVectorLayerProperties::on_pbnSaveDefaultStyle_clicked ()
641
641
{
642
+ apply (); // make sure the qml to save is uptodate
643
+
642
644
// a flag passed by reference
643
645
bool defaultSavedFlag = false ;
644
646
// after calling this the above flag will be set true for success
@@ -685,7 +687,7 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
685
687
if ( myFileDialog->selectedFilter () == tr ( " QGIS Layer Style File (*.qml)" ) )
686
688
{
687
689
// ensure the user never ommitted the extension from the filename
688
- if ( !myFileName.toUpper (). endsWith ( " .QML " ) )
690
+ if ( !myFileName.endsWith ( " .qml " , Qt::CaseInsensitive ) )
689
691
{
690
692
myFileName += " .qml" ;
691
693
}
@@ -714,7 +716,6 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
714
716
715
717
void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked ()
716
718
{
717
-
718
719
QSettings myQSettings; // where we keep last used filter in persistant state
719
720
QString myLastUsedDir = myQSettings.value ( " style/lastStyleDir" , " ." ).toString ();
720
721
@@ -746,11 +747,14 @@ void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked()
746
747
{
747
748
if ( myFileDialog->selectedFilter () == tr ( " QGIS Layer Style File (*.qml)" ) )
748
749
{
750
+ apply (); // make sure the qml to save is uptodate
751
+
749
752
// ensure the user never ommitted the extension from the filename
750
- if ( !myOutputFileName.toUpper (). endsWith ( " .QML " ) )
753
+ if ( !myOutputFileName.endsWith ( " .qml " , Qt::CaseInsensitive ) )
751
754
{
752
755
myOutputFileName += " .qml" ;
753
756
}
757
+
754
758
bool defaultLoadedFlag = false ;
755
759
QString myMessage = layer->saveNamedStyle ( myOutputFileName, defaultLoadedFlag );
756
760
// reset if the default style was loaded ok only
0 commit comments