Skip to content
Permalink
Browse files

Fix #7542 (crash in vector layer properties for geometryless layers)

  • Loading branch information
wonder-sk committed Apr 8, 2013
1 parent af98094 commit 4306632c74141f99f1541db9f12a0daf3e6b4043
Showing with 17 additions and 7 deletions.
  1. +17 −7 src/app/qgsvectorlayerproperties.cpp
@@ -413,8 +413,11 @@ void QgsVectorLayerProperties::apply()
// Apply fields settings
mFieldsPropertiesDialog->apply();

QgsRendererV2PropertiesDialog* dlg = static_cast<QgsRendererV2PropertiesDialog*>( widgetStackRenderers->currentWidget() );
dlg->apply();
if ( layer->rendererV2() )
{
QgsRendererV2PropertiesDialog* dlg = static_cast<QgsRendererV2PropertiesDialog*>( widgetStackRenderers->currentWidget() );
dlg->apply();
}

//apply diagram settings
diagramPropertiesDialog->apply();
@@ -774,12 +777,19 @@ void QgsVectorLayerProperties::updateSymbologyPage()
delete mRendererDialog;
mRendererDialog = 0;

mRendererDialog = new QgsRendererV2PropertiesDialog( layer, QgsStyleV2::defaultStyle(), true );
if ( layer->rendererV2() )
{
mRendererDialog = new QgsRendererV2PropertiesDialog( layer, QgsStyleV2::defaultStyle(), true );

// display the menu to choose the output format (fix #5136)
pbnSaveStyleAs->setText( tr( "Save Style" ) );
pbnSaveStyleAs->setMenu( mSaveAsMenu );
QObject::disconnect( pbnSaveStyleAs, SIGNAL( clicked() ), this, SLOT( on_pbnSaveStyleAs_clicked() ) );
// display the menu to choose the output format (fix #5136)
pbnSaveStyleAs->setText( tr( "Save Style" ) );
pbnSaveStyleAs->setMenu( mSaveAsMenu );
QObject::disconnect( pbnSaveStyleAs, SIGNAL( clicked() ), this, SLOT( on_pbnSaveStyleAs_clicked() ) );
}
else
{
tabWidget->setTabEnabled( 0, false ); // hide symbology item
}

if ( mRendererDialog )
{

0 comments on commit 4306632

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