Skip to content

Commit

Permalink
rule table now prevents duplicate entries
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayan authored and jef-n committed Mar 26, 2013
1 parent 0e35f75 commit 349b123
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/plugins/topology/rulesDialog.cpp
Expand Up @@ -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&) ) );
Expand Down Expand Up @@ -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 );

Expand Down

0 comments on commit 349b123

Please sign in to comment.