Skip to content

Commit

Permalink
Merge pull request #505 from vinayan/7477-add-rule-crash
Browse files Browse the repository at this point in the history
 [FIX #7477] Topology Checker - Crash as soon a layer is choosen when defining a rule
  • Loading branch information
mach0 committed Apr 8, 2013
2 parents 34adbe7 + 52da723 commit 51fc960
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 116 deletions.
12 changes: 6 additions & 6 deletions src/plugins/topology/checkDock.cpp
Original file line number Diff line number Diff line change
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
Loading

0 comments on commit 51fc960

Please sign in to comment.