Skip to content

Commit 51fc960

Browse files
committedApr 8, 2013
Merge pull request #505 from vinayan/7477-add-rule-crash
[FIX #7477] Topology Checker - Crash as soon a layer is choosen when defining a rule
2 parents 34adbe7 + 52da723 commit 51fc960

File tree

4 files changed

+132
-116
lines changed

4 files changed

+132
-116
lines changed
 

‎src/plugins/topology/checkDock.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,13 @@ checkDock::checkDock( QgisInterface* qIface, QWidget* parent )
5959
mErrorTableView->verticalHeader()->setDefaultSectionSize( 20 );
6060

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

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

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

97-
connect( mLayerRegistry, SIGNAL( layerWasAdded( QgsMapLayer* ) ), mConfigureDialog, SLOT( addLayer( QgsMapLayer* ) ) );
98-
connect( mLayerRegistry, SIGNAL( layerWillBeRemoved( QString ) ), mConfigureDialog, SLOT( removeLayer( QString ) ) );
9995
connect( mLayerRegistry, SIGNAL( layerWillBeRemoved( QString ) ), this, SLOT( parseErrorListByLayer( QString ) ) );
10096

10197
connect( this, SIGNAL( visibilityChanged( bool ) ), this, SLOT( updateRubberBands( bool ) ) );
98+
connect( qgsInterface, SIGNAL( newProjectCreated() ), mConfigureDialog, SLOT( clearRules() ) );
99+
connect( qgsInterface, SIGNAL( newProjectCreated() ), this, SLOT( deleteErrors() ) );
100+
102101
}
103102

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

205204
void checkDock::configure()
206205
{
206+
mConfigureDialog->initGui();
207207
mConfigureDialog->show();
208208
}
209209

0 commit comments

Comments
 (0)