Skip to content

Commit d54861a

Browse files
author
jef
committedJun 4, 2008
apply changes to layer before saving qml
git-svn-id: http://svn.osgeo.org/qgis/trunk@8589 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d8c475d commit d54861a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed
 

‎src/app/qgsvectorlayerproperties.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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()
158158
void QgsVectorLayerProperties::reset( void )
159159
{
160160
// populate the general information
@@ -639,6 +639,8 @@ void QgsVectorLayerProperties::on_pbnLoadDefaultStyle_clicked()
639639

640640
void 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

715717
void 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

Comments
 (0)
Please sign in to comment.