[QGIS Commit] r11343 - trunk/qgis/src/plugins/grass
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Tue Aug 11 09:29:52 EDT 2009
Author: rugginoso
Date: 2009-08-11 09:29:51 -0400 (Tue, 11 Aug 2009)
New Revision: 11343
Modified:
trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
Log:
Adapted the attribute table combobox to the "required" property of layer combobox.
Modified: trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp 2009-08-11 07:32:37 UTC (rev 11342)
+++ trunk/qgis/src/plugins/grass/qgsgrassmodule.cpp 2009-08-11 13:29:51 UTC (rev 11343)
@@ -2439,15 +2439,19 @@
{
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 @@
{
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 @@
{
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];
}
More information about the QGIS-commit
mailing list