Skip to content
Permalink
Browse files

fix warnings

git-svn-id: http://svn.osgeo.org/qgis/trunk@11345 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef
jef committed Aug 11, 2009
1 parent dfacd92 commit 456cef1aab822890d41b55d76bc58f8ea1217582
Showing with 28 additions and 41 deletions.
  1. +1 −2 src/app/qgisapp.cpp
  2. +26 −38 src/plugins/grass/qgsgrassmodule.cpp
  3. +1 −1 src/ui/qgsoptionsbase.ui
@@ -4656,7 +4656,6 @@ void QgisApp::isInOverview()

void QgisApp::removeLayer()
{
QgsLegendLayerFile* currentLayerFile = mMapLegend->currentLayerFile();
mMapLegend->legendLayerRemove();
// notify the project we've made a change
QgsProject::instance()->dirty( true );
@@ -5437,7 +5436,7 @@ void QgisApp::projectProperties()
//pass any refresg signals off to canvases
// Line below was commented out by wonder three years ago (r4949).
// It is needed to refresh scale bar after changing display units.
connect (pp,SIGNAL(refresh()), mMapCanvas, SLOT(refresh()));
connect( pp, SIGNAL( refresh() ), mMapCanvas, SLOT( refresh() ) );

QgsMapRenderer* myRender = mMapCanvas->mapRenderer();
bool wasProjected = myRender->hasCrsTransformEnabled();
@@ -2004,11 +2004,7 @@ QgsGrassModuleInput::QgsGrassModuleInput( QgsGrassModule *module,
adjustTitle();

// Check if this parameter is required
if (gnode.toElement().attribute("required") == "yes") {
mRequired = true;
} else {
mRequired = false;
}
mRequired = gnode.toElement().attribute( "required" ) == "yes";

QDomNode promptNode = gnode.namedItem( "gisprompt" );
QDomElement promptElem = promptNode.toElement();
@@ -2221,11 +2217,12 @@ void QgsGrassModuleInput::updateQgisLayers()

// If not required, add an empty item to combobox and a padding item into
// layer containers.
if (!mRequired){
mMaps.push_back(QString(""));
mVectorLayerNames.push_back(QString(""));
mMapLayers.push_back(NULL);
mLayerComboBox->addItem(tr("Select a layer"), QVariant());
if ( !mRequired )
{
mMaps.push_back( QString( "" ) );
mVectorLayerNames.push_back( QString( "" ) );
mMapLayers.push_back( NULL );
mLayerComboBox->addItem( tr( "Select a layer" ), QVariant() );
}

QgsMapCanvas *canvas = mModule->qgisIface()->mapCanvas();
@@ -2439,18 +2436,16 @@ std::vector<QgsField> QgsGrassModuleInput::currentFields()
{
QgsDebugMsg( "called." );

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

std::vector<QgsField> fields;

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

unsigned current = c;

if ( current >= limit && current < mVectorFields.size() )
{
fields = mVectorFields[current];
@@ -2463,16 +2458,14 @@ QgsMapLayer * QgsGrassModuleInput::currentLayer()
{
QgsDebugMsg( "called." );

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

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

unsigned int current = c;

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

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

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

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

if ( current >= limit && current < mMaps.size() )
{
@@ -2646,11 +2637,7 @@ QgsGrassModuleGdalInput::QgsGrassModuleGdalInput(
adjustTitle();

// Check if this parameter is required
if (gnode.toElement().attribute("required") == "yes") {
mRequired = true;
} else {
mRequired = false;
}
mRequired = gnode.toElement().attribute( "required" ) == "yes";

QDomNode promptNode = gnode.namedItem( "gisprompt" );
QDomElement promptElem = promptNode.toElement();
@@ -2721,10 +2708,11 @@ void QgsGrassModuleGdalInput::updateQgisLayers()

// If not required, add an empty item to combobox and a padding item into
// layer containers.
if (!mRequired){
mUri.push_back(QString());
mOgrLayers.push_back(QString());
mLayerComboBox->addItem(tr("Select a layer"), QVariant());
if ( !mRequired )
{
mUri.push_back( QString() );
mOgrLayers.push_back( QString() );
mLayerComboBox->addItem( tr( "Select a layer" ), QVariant() );
}

QgsMapCanvas *canvas = mModule->qgisIface()->mapCanvas();
@@ -477,7 +477,7 @@
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="textLabel1_8">
<widget class="QLabel" name="textLabel1_11">
<property name="text">
<string>Preferred measurements units</string>
</property>

0 comments on commit 456cef1

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