Skip to content

Commit 06b709d

Browse files
author
jef
committed
fix warning
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@12706 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d25091e commit 06b709d

File tree

1 file changed

+31
-22
lines changed

1 file changed

+31
-22
lines changed

src/plugins/grass/qgsgrassmodule.cpp

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -384,31 +384,33 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
384384
QHBoxLayout *mypAdvancedPushButtonFrameLayout = new QHBoxLayout( mypAdvancedPushButtonFrame );
385385
connect( &mAdvancedPushButton, SIGNAL( clicked() ), this, SLOT( switchAdvanced() ) );
386386
mypAdvancedPushButtonFrameLayout->addWidget( &mAdvancedPushButton );
387-
mypAdvancedPushButtonFrameLayout->addStretch(1);
387+
mypAdvancedPushButtonFrameLayout->addStretch( 1 );
388388

389389
mypInnerFrameLayout->addWidget( mypSimpleFrame );
390390
mypInnerFrameLayout->addWidget( mypAdvancedPushButtonFrame );
391391
mypInnerFrameLayout->addWidget( &mAdvancedFrame );
392-
mypInnerFrameLayout->addStretch(1);
392+
mypInnerFrameLayout->addStretch( 1 );
393393

394394
// Hide advanced and set butto next
395395
switchAdvanced();
396-
396+
397397
QVBoxLayout *mypSimpleLayout = new QVBoxLayout( mypSimpleFrame );
398398
QVBoxLayout *mypAdvancedLayout = new QVBoxLayout( &mAdvancedFrame );
399-
QVBoxLayout *layout;
399+
QVBoxLayout *layout = 0;
400400
while ( !n.isNull() )
401401
{
402402
QDomElement e = n.toElement();
403403
if ( !e.isNull() )
404404
{
405405
QString optionType = e.tagName();
406406
QgsDebugMsg( "optionType = " + optionType );
407-
408-
if ( e.attribute( "advanced", "no" ) == "yes" )
407+
408+
if ( e.attribute( "advanced", "no" ) == "yes" )
409409
{
410410
layout = mypAdvancedLayout;
411-
} else {
411+
}
412+
else
413+
{
412414
layout = mypSimpleLayout;
413415
}
414416

@@ -505,8 +507,8 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
505507
}
506508
n = n.nextSibling();
507509
}
508-
509-
if ( mypAdvancedLayout->count() == 0 )
510+
511+
if ( mypAdvancedLayout->count() == 0 )
510512
{
511513
mypAdvancedPushButtonFrame->hide();
512514
}
@@ -531,18 +533,22 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
531533
n = n.nextSibling();
532534
}
533535

534-
layout->addStretch();
536+
if ( layout )
537+
layout->addStretch();
535538
}
536539

537540
void QgsGrassModuleStandardOptions::switchAdvanced()
538541
{
539-
if ( mAdvancedFrame.isHidden() ) {
540-
mAdvancedFrame.show();
541-
mAdvancedPushButton.setText ( tr("<< Hide advanced options") );
542-
} else {
543-
mAdvancedFrame.hide();
544-
mAdvancedPushButton.setText ( tr("Show advanced options >>") );
545-
}
542+
if ( mAdvancedFrame.isHidden() )
543+
{
544+
mAdvancedFrame.show();
545+
mAdvancedPushButton.setText( tr( "<< Hide advanced options" ) );
546+
}
547+
else
548+
{
549+
mAdvancedFrame.hide();
550+
mAdvancedPushButton.setText( tr( "Show advanced options >>" ) );
551+
}
546552
}
547553

548554
QStringList QgsGrassModuleStandardOptions::arguments()
@@ -1412,7 +1418,7 @@ void QgsGrassModule::readStdout()
14121418
{
14131419
//line = QString::fromLocal8Bit( mProcess.readLineStdout().ascii() );
14141420
QByteArray ba = mProcess.readLine();
1415-
line = QString::fromUtf8( ba ).replace('\n', "" );
1421+
line = QString::fromUtf8( ba ).replace( '\n', "" );
14161422
//QgsDebugMsg(QString("line: '%1'").arg(line));
14171423

14181424
// GRASS_INFO_PERCENT is catched here only because of bugs in GRASS,
@@ -1447,7 +1453,7 @@ void QgsGrassModule::readStderr()
14471453
{
14481454
//line = QString::fromLocal8Bit( mProcess.readLineStderr().ascii() );
14491455
QByteArray ba = mProcess.readLine();
1450-
line = QString::fromUtf8( ba ).replace('\n', "" );
1456+
line = QString::fromUtf8( ba ).replace( '\n', "" );
14511457
//QgsDebugMsg(QString("line: '%1'").arg(line));
14521458

14531459
if ( rxpercent.indexIn( line ) != -1 )
@@ -2654,7 +2660,7 @@ QgsGrassModuleGdalInput::QgsGrassModuleGdalInput(
26542660
{
26552661
if ( mTitle.isEmpty() )
26562662
{
2657-
mTitle = tr("OGR/PostGIS/GDAL Input");
2663+
mTitle = tr( "OGR/PostGIS/GDAL Input" );
26582664
}
26592665
adjustTitle();
26602666

@@ -2929,9 +2935,12 @@ QgsGrassModuleField::QgsGrassModuleField(
29292935
mType = qdesc.attribute( "type" );
29302936

29312937
mLayerKey = qdesc.attribute( "layer" );
2932-
if ( mLayerKey.isNull() || mLayerKey.length() == 0 ) {
2938+
if ( mLayerKey.isNull() || mLayerKey.length() == 0 )
2939+
{
29332940
QMessageBox::warning( 0, tr( "Warning" ), tr( "'layer' attribute in field tag with key= %1 is missing." ).arg( mKey ) );
2934-
} else {
2941+
}
2942+
else
2943+
{
29352944
QgsGrassModuleItem *item = mModuleStandardOptions->itemByKey( mLayerKey );
29362945
// TODO check type
29372946
if ( item )

0 commit comments

Comments
 (0)