Skip to content
Permalink
Browse files

rule table now prevents duplicate entries

  • Loading branch information
vinayan authored and jef-n committed Mar 26, 2013
1 parent 0e35f75 commit 349b1235afd2c173908a8fa23e934b22df22246c
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/plugins/topology/rulesDialog.cpp
@@ -62,6 +62,8 @@ rulesDialog::rulesDialog( QList<QString> layerList, QMap<QString, TopologyRule>
// add layer name to the layer combo boxes
mLayer1Box->addItem( v1->name(), v1->id() );
//mLayer2Box->addItem((( QgsVectorLayer* )layerRegistry->mapLayers()[layerList[i]] )->name() );


}

connect (mLayer1Box, SIGNAL( currentIndexChanged(const QString&) ),this, SLOT( updateRuleItems(const QString&) ) );
@@ -248,6 +250,16 @@ void rulesDialog::addTest()
if ( layer2 == "No layer" && mTestConfMap[test].useSecondLayer )
return;

for (int i = 0; i < mTestTable->rowCount(); ++i)
{
if( mTestTable->item(i,0)->text() == test &&
mTestTable->item(i,1)->text() == layer1 &&
mTestTable->item(i,2)->text() == layer2 )
{
return;
}
}

int row = mTestTable->rowCount();
mTestTable->insertRow( row );

0 comments on commit 349b123

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