Skip to content

Commit

Permalink
[GRASS] vector input type option fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Sep 21, 2015
1 parent 72af56d commit 992bacc
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions src/plugins/grass/qgsgrassmoduleinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,35 +1044,34 @@ void QgsGrassModuleInput::onLayerChanged()
}

QgsGrassVectorLayer * layer = currentLayer();
if ( multiple() )
if ( layer )
if ( layer )
{
// number of types in the layer matching mGeometryTypeMask
int typeCount = 0;
foreach ( int type, layer->types() )
{
// number of types in the layer matching mGeometryTypeMask
int typeCount = 0;
foreach ( int type, layer->types() )
if ( type & mGeometryTypeMask )
{
if ( type & mGeometryTypeMask )
{
typeCount++;
}
typeCount++;
}
QgsDebugMsg( QString( "typeCount = %1" ).arg( typeCount ) );
}
QgsDebugMsg( QString( "typeCount = %1" ).arg( typeCount ) );

int layerType = layer->type(); // may be multiple
foreach ( int checkBoxType, mTypeCheckBoxes.keys() )
int layerType = layer->type(); // may be multiple
foreach ( int checkBoxType, mTypeCheckBoxes.keys() )
{
QCheckBox *checkBox = mTypeCheckBoxes.value( checkBoxType );
checkBox->hide();
if ( checkBoxType & layerType )
{
QCheckBox *checkBox = mTypeCheckBoxes.value( checkBoxType );
checkBox->hide();
if ( checkBoxType & layerType )
checkBox->setChecked( true );
if ( typeCount > 1 )
{
checkBox->setChecked( true );
if ( typeCount > 1 )
{
checkBox->show();
}
checkBox->show();
}
}
}
}

emit valueChanged();
}
Expand Down

0 comments on commit 992bacc

Please sign in to comment.