Skip to content

Commit

Permalink
fix crash as soon a layer is choosen when defining a rule
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayan committed Apr 6, 2013
1 parent 04119d8 commit 31905ca
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 114 deletions.
12 changes: 6 additions & 6 deletions src/plugins/topology/checkDock.cpp
Expand Up @@ -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 );
Expand All @@ -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()
Expand Down Expand Up @@ -204,6 +203,7 @@ void checkDock::parseErrorListByFeature( int featureId )

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

Expand Down

0 comments on commit 31905ca

Please sign in to comment.