Skip to content
Permalink
Browse files

fix crash as soon a layer is choosen when defining a rule

  • Loading branch information
vinayan committed Apr 6, 2013
1 parent 04119d8 commit 31905ca29078dd3c38b8b7416729176fcbe429df
@@ -59,15 +59,13 @@ checkDock::checkDock( QgisInterface* qIface, QWidget* parent )
mErrorTableView->verticalHeader()->setDefaultSectionSize( 20 );

mLayerRegistry = QgsMapLayerRegistry::instance();
mConfigureDialog = new rulesDialog( mLayerRegistry->mapLayers().keys(), mTest->testMap(), qIface, parent );
mTestTable = mConfigureDialog->testTable();
mConfigureDialog = new rulesDialog( mTest->testMap(), qIface, parent );
mTestTable = mConfigureDialog->rulesTable();

mValidateExtentButton->setIcon( QIcon( ":/topology/validateExtent.png" ) );
mValidateAllButton->setIcon( QIcon( ":/topology/validateAll.png" ) );
mConfigureButton->setIcon( QIcon( ":/topology/configureRules.png" ) );


// mQgisApp = QgisApp::instance();
QgsMapCanvas* canvas = qIface->mapCanvas();// mQgisApp->mapCanvas();
mRBFeature1 = new QgsRubberBand( canvas );
mRBFeature2 = new QgsRubberBand( canvas );
@@ -94,11 +92,12 @@ checkDock::checkDock( QgisInterface* qIface, QWidget* parent )
connect( mFixButton, SIGNAL( clicked() ), this, SLOT( fix() ) );
connect( mErrorTableView, SIGNAL( clicked( const QModelIndex & ) ), this, SLOT( errorListClicked( const QModelIndex & ) ) );

connect( mLayerRegistry, SIGNAL( layerWasAdded( QgsMapLayer* ) ), mConfigureDialog, SLOT( addLayer( QgsMapLayer* ) ) );
connect( mLayerRegistry, SIGNAL( layerWillBeRemoved( QString ) ), mConfigureDialog, SLOT( removeLayer( QString ) ) );
connect( mLayerRegistry, SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( parseErrorListByLayer( QString ) ) );

connect( this, SIGNAL( visibilityChanged( bool ) ), this, SLOT( updateRubberBands( bool ) ) );
connect( qgsInterface, SIGNAL( newProjectCreated() ), mConfigureDialog, SLOT( clearRules() ) );
connect( qgsInterface, SIGNAL( newProjectCreated() ), this, SLOT( deleteErrors() ) );

}

checkDock::~checkDock()
@@ -204,6 +203,7 @@ void checkDock::parseErrorListByFeature( int featureId )

void checkDock::configure()
{
mConfigureDialog->initGui();
mConfigureDialog->show();
}

0 comments on commit 31905ca

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