Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11345 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 11, 2009
1 parent a51e774 commit c972a9c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 41 deletions.
3 changes: 1 addition & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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();
Expand Down
64 changes: 26 additions & 38 deletions src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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];
Expand All @@ -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];
Expand All @@ -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() )
{
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/ui/qgsoptionsbase.ui
Expand Up @@ -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>
Expand Down

0 comments on commit c972a9c

Please sign in to comment.