Skip to content

Commit 349b123

Browse files
vinayanjef-n
authored andcommittedMar 26, 2013
rule table now prevents duplicate entries
1 parent 0e35f75 commit 349b123

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎src/plugins/topology/rulesDialog.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ rulesDialog::rulesDialog( QList<QString> layerList, QMap<QString, TopologyRule>
6262
// add layer name to the layer combo boxes
6363
mLayer1Box->addItem( v1->name(), v1->id() );
6464
//mLayer2Box->addItem((( QgsVectorLayer* )layerRegistry->mapLayers()[layerList[i]] )->name() );
65+
66+
6567
}
6668

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

253+
for (int i = 0; i < mTestTable->rowCount(); ++i)
254+
{
255+
if( mTestTable->item(i,0)->text() == test &&
256+
mTestTable->item(i,1)->text() == layer1 &&
257+
mTestTable->item(i,2)->text() == layer2 )
258+
{
259+
return;
260+
}
261+
}
262+
251263
int row = mTestTable->rowCount();
252264
mTestTable->insertRow( row );
253265

0 commit comments

Comments
 (0)
Please sign in to comment.