Skip to content
Permalink
Browse files

Adapted the attribute table combobox to the "required" property of la…

…yer combobox.

git-svn-id: http://svn.osgeo.org/qgis/trunk@11343 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rugginoso
rugginoso committed Aug 11, 2009
1 parent aeb951a commit 4fe683b349b4f8985326ea182f7a613afc684be9
Showing with 18 additions and 6 deletions.
  1. +18 −6 src/plugins/grass/qgsgrassmodule.cpp
@@ -2439,15 +2439,19 @@ std::vector<QgsField> QgsGrassModuleInput::currentFields()
{
QgsDebugMsg( "called." );

int limit = 0;
if (!mRequired)
limit = 1;

std::vector<QgsField> fields;

int c = mLayerComboBox->currentIndex();
if ( c < 0 )
if ( c < limit )
return fields;

unsigned current = c;

if ( current >= 0 && current < mVectorFields.size() )
if ( current >= limit && current < mVectorFields.size() )
{
fields = mVectorFields[current];
}
@@ -2459,13 +2463,17 @@ QgsMapLayer * QgsGrassModuleInput::currentLayer()
{
QgsDebugMsg( "called." );

int limit = 0;
if (!mRequired)
limit = 1;

int c = mLayerComboBox->currentIndex();
if ( c < 0 )
if ( c < limit )
return 0;

unsigned int current = c;

if ( current >= 0 && current < mMapLayers.size() )
if ( current >= limit && current < mMapLayers.size() )
{
return mMapLayers[current];
}
@@ -2477,13 +2485,17 @@ QString QgsGrassModuleInput::currentMap()
{
QgsDebugMsg( "called." );

int limit = 0;
if (!mRequired)
limit = 1;

int c = mLayerComboBox->currentIndex();
if ( c < 0 )
if ( c < limit )
return QString();

unsigned int current = c;

if ( current >= 0 && current < mMaps.size() )
if ( current >= limit && current < mMaps.size() )
{
return mMaps[current];
}

0 comments on commit 4fe683b

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