Skip to content
Permalink
Browse files

Fix #7134

  • Loading branch information
NathanW2 authored and dakcarto committed May 29, 2013
1 parent e0406e7 commit 87ca653e8987069950bd9e65bdb9666c8daacf1c
@@ -8758,7 +8758,7 @@ void QgisApp::showLayerProperties( QgsMapLayer *ml )
QgsVectorLayerProperties *vlp = NULL; // See note above about reusing this
if ( vlp )
{
vlp->reset();
vlp->syncToLayer();
}
else
{

Large diffs are not rendered by default.

@@ -40,6 +40,7 @@ class QgsLabelingGui : public QWidget, private Ui::QgsLabelingGuiBase
void writeSettingsToLayer();

public slots:
void init();
void collapseSample( bool collapse );
void apply();
void changeTextColor( const QColor &color );
@@ -171,7 +171,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
connect( mFieldsPropertiesDialog, SIGNAL( toggleEditing() ), this, SLOT( toggleEditing() ) );
connect( this, SIGNAL( toggleEditing( QgsMapLayer* ) ), QgisApp::instance(), SLOT( toggleEditing( QgsMapLayer* ) ) );

reset();
syncToLayer();

if ( layer->dataProvider() )//enable spatial index button group if supported by provider
{
@@ -337,7 +337,7 @@ void QgsVectorLayerProperties::setDisplayField( QString name )
}

//! @note in raster props, this method is called sync()
void QgsVectorLayerProperties::reset( void )
void QgsVectorLayerProperties::syncToLayer( void )
{
// populate the general information
mLayerOrigNameLineEdit->setText( layer->originalName() );
@@ -393,6 +393,7 @@ void QgsVectorLayerProperties::reset( void )
layer->label()->setFields( layer->pendingFields() );

actionDialog->init();
labelingDialog->init();

if ( layer->hasGeometryType() )
{
@@ -605,7 +606,7 @@ void QgsVectorLayerProperties::on_pbnLoadDefaultStyle_clicked()
}
else
{
reset();
syncToLayer();
}

return;
@@ -621,7 +622,7 @@ void QgsVectorLayerProperties::on_pbnLoadDefaultStyle_clicked()
if ( defaultLoadedFlag )
{
// all worked ok so no need to inform user
reset();
syncToLayer();
}
else
{
@@ -696,7 +697,7 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
//reset if the default style was loaded ok only
if ( defaultLoadedFlag )
{
reset();
syncToLayer();
}
else
{
@@ -813,7 +814,7 @@ void QgsVectorLayerProperties::saveStyleAs( StyleType styleType )
//reset if the default style was loaded ok only
if ( defaultLoadedFlag )
{
reset();
syncToLayer();
}
else
{
@@ -875,7 +876,7 @@ void QgsVectorLayerProperties::showListOfStylesFromDatabase()
}
if ( layer->applyNamedStyle( qmlStyle, errorMsg ) )
{
reset();
syncToLayer();
}
else
{
@@ -81,7 +81,7 @@ class QgsVectorLayerProperties : public QgsOptionsDialogBase, private Ui::QgsVec
void insertExpression();

/** Reset to original (vector layer) values */
void reset();
void syncToLayer();

/** Get metadata about the layer in nice formatted html */
QString metadata();
@@ -942,7 +942,7 @@ QString QgsMapLayer::saveDefaultStyle( bool & theResultFlag )
return saveNamedStyle( styleURI(), theResultFlag );
}

QString QgsMapLayer::saveNamedStyle( const QString theURI, bool & theResultFlag )
QString QgsMapLayer:: saveNamedStyle( const QString theURI, bool & theResultFlag )
{
QString myErrorMessage;
QDomDocument myDocument;
@@ -3914,16 +3914,13 @@ QString QgsVectorLayer::loadNamedStyle( const QString theURI, bool &theResultFla
if ( !qml.isEmpty() )
{
theResultFlag = this->applyNamedStyle( qml, errorMsg );
return QObject::tr( "Loaded from Provider" );
}
}
}

}
if ( !theResultFlag )
{
return QgsMapLayer::loadNamedStyle( theURI, theResultFlag );
}
return QObject::tr( "Loaded from Provider" );

return QgsMapLayer::loadNamedStyle( theURI, theResultFlag );
}

bool QgsVectorLayer::applyNamedStyle( QString namedStyle, QString errorMsg )

0 comments on commit 87ca653

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