Skip to content

Commit c972a9c

Browse files
author
jef
committed
fix warnings
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11345 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent a51e774 commit c972a9c

File tree

3 files changed

+28
-41
lines changed

3 files changed

+28
-41
lines changed

src/app/qgisapp.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -4656,7 +4656,6 @@ void QgisApp::isInOverview()
46564656

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

54425441
QgsMapRenderer* myRender = mMapCanvas->mapRenderer();
54435442
bool wasProjected = myRender->hasCrsTransformEnabled();

src/plugins/grass/qgsgrassmodule.cpp

+26-38
Original file line numberDiff line numberDiff line change
@@ -2004,11 +2004,7 @@ QgsGrassModuleInput::QgsGrassModuleInput( QgsGrassModule *module,
20042004
adjustTitle();
20052005

20062006
// Check if this parameter is required
2007-
if (gnode.toElement().attribute("required") == "yes") {
2008-
mRequired = true;
2009-
} else {
2010-
mRequired = false;
2011-
}
2007+
mRequired = gnode.toElement().attribute( "required" ) == "yes";
20122008

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

22222218
// If not required, add an empty item to combobox and a padding item into
22232219
// layer containers.
2224-
if (!mRequired){
2225-
mMaps.push_back(QString(""));
2226-
mVectorLayerNames.push_back(QString(""));
2227-
mMapLayers.push_back(NULL);
2228-
mLayerComboBox->addItem(tr("Select a layer"), QVariant());
2220+
if ( !mRequired )
2221+
{
2222+
mMaps.push_back( QString( "" ) );
2223+
mVectorLayerNames.push_back( QString( "" ) );
2224+
mMapLayers.push_back( NULL );
2225+
mLayerComboBox->addItem( tr( "Select a layer" ), QVariant() );
22292226
}
22302227

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

2442-
int limit = 0;
2443-
if (!mRequired)
2439+
unsigned int limit = 0;
2440+
if ( !mRequired )
24442441
limit = 1;
24452442

24462443
std::vector<QgsField> fields;
24472444

2448-
int c = mLayerComboBox->currentIndex();
2449-
if ( c < limit )
2445+
unsigned int current = mLayerComboBox->currentIndex();
2446+
if ( current < limit )
24502447
return fields;
24512448

2452-
unsigned current = c;
2453-
24542449
if ( current >= limit && current < mVectorFields.size() )
24552450
{
24562451
fields = mVectorFields[current];
@@ -2463,16 +2458,14 @@ QgsMapLayer * QgsGrassModuleInput::currentLayer()
24632458
{
24642459
QgsDebugMsg( "called." );
24652460

2466-
int limit = 0;
2467-
if (!mRequired)
2461+
unsigned int limit = 0;
2462+
if ( !mRequired )
24682463
limit = 1;
24692464

2470-
int c = mLayerComboBox->currentIndex();
2471-
if ( c < limit )
2465+
unsigned int current = mLayerComboBox->currentIndex();
2466+
if ( current < limit )
24722467
return 0;
24732468

2474-
unsigned int current = c;
2475-
24762469
if ( current >= limit && current < mMapLayers.size() )
24772470
{
24782471
return mMapLayers[current];
@@ -2485,15 +2478,13 @@ QString QgsGrassModuleInput::currentMap()
24852478
{
24862479
QgsDebugMsg( "called." );
24872480

2488-
int limit = 0;
2489-
if (!mRequired)
2481+
unsigned int limit = 0;
2482+
if ( !mRequired )
24902483
limit = 1;
2491-
2492-
int c = mLayerComboBox->currentIndex();
2493-
if ( c < limit )
2494-
return QString();
24952484

2496-
unsigned int current = c;
2485+
unsigned int current = mLayerComboBox->currentIndex();
2486+
if ( current < limit )
2487+
return QString();
24972488

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

26482639
// Check if this parameter is required
2649-
if (gnode.toElement().attribute("required") == "yes") {
2650-
mRequired = true;
2651-
} else {
2652-
mRequired = false;
2653-
}
2640+
mRequired = gnode.toElement().attribute( "required" ) == "yes";
26542641

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

27222709
// If not required, add an empty item to combobox and a padding item into
27232710
// layer containers.
2724-
if (!mRequired){
2725-
mUri.push_back(QString());
2726-
mOgrLayers.push_back(QString());
2727-
mLayerComboBox->addItem(tr("Select a layer"), QVariant());
2711+
if ( !mRequired )
2712+
{
2713+
mUri.push_back( QString() );
2714+
mOgrLayers.push_back( QString() );
2715+
mLayerComboBox->addItem( tr( "Select a layer" ), QVariant() );
27282716
}
27292717

27302718
QgsMapCanvas *canvas = mModule->qgisIface()->mapCanvas();

src/ui/qgsoptionsbase.ui

+1-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@
477477
</widget>
478478
</item>
479479
<item row="2" column="0">
480-
<widget class="QLabel" name="textLabel1_8">
480+
<widget class="QLabel" name="textLabel1_11">
481481
<property name="text">
482482
<string>Preferred measurements units</string>
483483
</property>

0 commit comments

Comments
 (0)