[QGIS Commit] r8589 - trunk/qgis/src/app
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Wed Jun 4 12:55:36 EDT 2008
Author: jef
Date: 2008-06-04 12:55:36 -0400 (Wed, 04 Jun 2008)
New Revision: 8589
Modified:
trunk/qgis/src/app/qgsvectorlayerproperties.cpp
Log:
apply changes to layer before saving qml
Modified: trunk/qgis/src/app/qgsvectorlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsvectorlayerproperties.cpp 2008-06-04 16:54:14 UTC (rev 8588)
+++ trunk/qgis/src/app/qgsvectorlayerproperties.cpp 2008-06-04 16:55:36 UTC (rev 8589)
@@ -154,7 +154,7 @@
displayFieldComboBox->setCurrentText(name);
}
-//! @note in raster props, this metho d is called sync()
+//! @note in raster props, this method is called sync()
void QgsVectorLayerProperties::reset( void )
{
// populate the general information
@@ -639,6 +639,8 @@
void QgsVectorLayerProperties::on_pbnSaveDefaultStyle_clicked()
{
+ apply(); // make sure the qml to save is uptodate
+
// a flag passed by reference
bool defaultSavedFlag = false;
// after calling this the above flag will be set true for success
@@ -685,7 +687,7 @@
if ( myFileDialog->selectedFilter() == tr ( "QGIS Layer Style File (*.qml)" ) )
{
//ensure the user never ommitted the extension from the filename
- if ( !myFileName.toUpper().endsWith ( ".QML" ) )
+ if ( !myFileName.endsWith( ".qml", Qt::CaseInsensitive ) )
{
myFileName += ".qml";
}
@@ -714,7 +716,6 @@
void QgsVectorLayerProperties::on_pbnSaveStyleAs_clicked()
{
-
QSettings myQSettings; // where we keep last used filter in persistant state
QString myLastUsedDir = myQSettings.value ( "style/lastStyleDir", "." ).toString();
@@ -746,11 +747,14 @@
{
if ( myFileDialog->selectedFilter() == tr ( "QGIS Layer Style File (*.qml)" ) )
{
+ apply(); // make sure the qml to save is uptodate
+
//ensure the user never ommitted the extension from the filename
- if ( !myOutputFileName.toUpper().endsWith ( ".QML" ) )
+ if ( !myOutputFileName.endsWith ( ".qml", Qt::CaseInsensitive ) )
{
myOutputFileName += ".qml";
}
+
bool defaultLoadedFlag = false;
QString myMessage = layer->saveNamedStyle( myOutputFileName, defaultLoadedFlag );
//reset if the default style was loaded ok only
More information about the QGIS-commit
mailing list