Skip to content

Commit

Permalink
Fix #7134
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanW2 authored and dakcarto committed May 29, 2013
1 parent e0406e7 commit 87ca653
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 209 deletions.
2 changes: 1 addition & 1 deletion src/app/qgisapp.cpp
Expand Up @@ -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
{
Expand Down
397 changes: 204 additions & 193 deletions src/app/qgslabelinggui.cpp

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/app/qgslabelinggui.h
Expand Up @@ -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 );
Expand Down
15 changes: 8 additions & 7 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -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
{
Expand Down Expand Up @@ -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() );
Expand Down Expand Up @@ -393,6 +393,7 @@ void QgsVectorLayerProperties::reset( void )
layer->label()->setFields( layer->pendingFields() );

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

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

return;
Expand All @@ -621,7 +622,7 @@ void QgsVectorLayerProperties::on_pbnLoadDefaultStyle_clicked()
if ( defaultLoadedFlag )
{
// all worked ok so no need to inform user
reset();
syncToLayer();
}
else
{
Expand Down Expand Up @@ -696,7 +697,7 @@ void QgsVectorLayerProperties::on_pbnLoadStyle_clicked()
//reset if the default style was loaded ok only
if ( defaultLoadedFlag )
{
reset();
syncToLayer();
}
else
{
Expand Down Expand Up @@ -813,7 +814,7 @@ void QgsVectorLayerProperties::saveStyleAs( StyleType styleType )
//reset if the default style was loaded ok only
if ( defaultLoadedFlag )
{
reset();
syncToLayer();
}
else
{
Expand Down Expand Up @@ -875,7 +876,7 @@ void QgsVectorLayerProperties::showListOfStylesFromDatabase()
}
if ( layer->applyNamedStyle( qmlStyle, errorMsg ) )
{
reset();
syncToLayer();
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsvectorlayerproperties.h
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayer.cpp
Expand Up @@ -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;
Expand Down
9 changes: 3 additions & 6 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -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 )
Expand Down

0 comments on commit 87ca653

Please sign in to comment.