Skip to content

Commit 992bacc

Browse files
committedSep 21, 2015
[GRASS] vector input type option fix
1 parent 72af56d commit 992bacc

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed
 

‎src/plugins/grass/qgsgrassmoduleinput.cpp

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,35 +1044,34 @@ void QgsGrassModuleInput::onLayerChanged()
10441044
}
10451045

10461046
QgsGrassVectorLayer * layer = currentLayer();
1047-
if ( multiple() )
1048-
if ( layer )
1047+
if ( layer )
1048+
{
1049+
// number of types in the layer matching mGeometryTypeMask
1050+
int typeCount = 0;
1051+
foreach ( int type, layer->types() )
10491052
{
1050-
// number of types in the layer matching mGeometryTypeMask
1051-
int typeCount = 0;
1052-
foreach ( int type, layer->types() )
1053+
if ( type & mGeometryTypeMask )
10531054
{
1054-
if ( type & mGeometryTypeMask )
1055-
{
1056-
typeCount++;
1057-
}
1055+
typeCount++;
10581056
}
1059-
QgsDebugMsg( QString( "typeCount = %1" ).arg( typeCount ) );
1057+
}
1058+
QgsDebugMsg( QString( "typeCount = %1" ).arg( typeCount ) );
10601059

1061-
int layerType = layer->type(); // may be multiple
1062-
foreach ( int checkBoxType, mTypeCheckBoxes.keys() )
1060+
int layerType = layer->type(); // may be multiple
1061+
foreach ( int checkBoxType, mTypeCheckBoxes.keys() )
1062+
{
1063+
QCheckBox *checkBox = mTypeCheckBoxes.value( checkBoxType );
1064+
checkBox->hide();
1065+
if ( checkBoxType & layerType )
10631066
{
1064-
QCheckBox *checkBox = mTypeCheckBoxes.value( checkBoxType );
1065-
checkBox->hide();
1066-
if ( checkBoxType & layerType )
1067+
checkBox->setChecked( true );
1068+
if ( typeCount > 1 )
10671069
{
1068-
checkBox->setChecked( true );
1069-
if ( typeCount > 1 )
1070-
{
1071-
checkBox->show();
1072-
}
1070+
checkBox->show();
10731071
}
10741072
}
10751073
}
1074+
}
10761075

10771076
emit valueChanged();
10781077
}

0 commit comments

Comments
 (0)
Please sign in to comment.