Skip to content

Commit

Permalink
fix warning
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@12706 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Jan 8, 2010
1 parent 4d537dd commit 987a9b6
Showing 1 changed file with 31 additions and 22 deletions.
53 changes: 31 additions & 22 deletions src/plugins/grass/qgsgrassmodule.cpp
Expand Up @@ -384,31 +384,33 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
QHBoxLayout *mypAdvancedPushButtonFrameLayout = new QHBoxLayout( mypAdvancedPushButtonFrame );
connect( &mAdvancedPushButton, SIGNAL( clicked() ), this, SLOT( switchAdvanced() ) );
mypAdvancedPushButtonFrameLayout->addWidget( &mAdvancedPushButton );
mypAdvancedPushButtonFrameLayout->addStretch(1);
mypAdvancedPushButtonFrameLayout->addStretch( 1 );

mypInnerFrameLayout->addWidget( mypSimpleFrame );
mypInnerFrameLayout->addWidget( mypAdvancedPushButtonFrame );
mypInnerFrameLayout->addWidget( &mAdvancedFrame );
mypInnerFrameLayout->addStretch(1);
mypInnerFrameLayout->addStretch( 1 );

// Hide advanced and set butto next
switchAdvanced();

QVBoxLayout *mypSimpleLayout = new QVBoxLayout( mypSimpleFrame );
QVBoxLayout *mypAdvancedLayout = new QVBoxLayout( &mAdvancedFrame );
QVBoxLayout *layout;
QVBoxLayout *layout = 0;
while ( !n.isNull() )
{
QDomElement e = n.toElement();
if ( !e.isNull() )
{
QString optionType = e.tagName();
QgsDebugMsg( "optionType = " + optionType );
if ( e.attribute( "advanced", "no" ) == "yes" )

if ( e.attribute( "advanced", "no" ) == "yes" )
{
layout = mypAdvancedLayout;
} else {
}
else
{
layout = mypSimpleLayout;
}

Expand Down Expand Up @@ -505,8 +507,8 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
}
n = n.nextSibling();
}
if ( mypAdvancedLayout->count() == 0 )

if ( mypAdvancedLayout->count() == 0 )
{
mypAdvancedPushButtonFrame->hide();
}
Expand All @@ -531,18 +533,22 @@ QgsGrassModuleStandardOptions::QgsGrassModuleStandardOptions(
n = n.nextSibling();
}

layout->addStretch();
if ( layout )
layout->addStretch();
}

void QgsGrassModuleStandardOptions::switchAdvanced()
{
if ( mAdvancedFrame.isHidden() ) {
mAdvancedFrame.show();
mAdvancedPushButton.setText ( tr("<< Hide advanced options") );
} else {
mAdvancedFrame.hide();
mAdvancedPushButton.setText ( tr("Show advanced options >>") );
}
if ( mAdvancedFrame.isHidden() )
{
mAdvancedFrame.show();
mAdvancedPushButton.setText( tr( "<< Hide advanced options" ) );
}
else
{
mAdvancedFrame.hide();
mAdvancedPushButton.setText( tr( "Show advanced options >>" ) );
}
}

QStringList QgsGrassModuleStandardOptions::arguments()
Expand Down Expand Up @@ -1412,7 +1418,7 @@ void QgsGrassModule::readStdout()
{
//line = QString::fromLocal8Bit( mProcess.readLineStdout().ascii() );
QByteArray ba = mProcess.readLine();
line = QString::fromUtf8( ba ).replace('\n', "" );
line = QString::fromUtf8( ba ).replace( '\n', "" );
//QgsDebugMsg(QString("line: '%1'").arg(line));

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

if ( rxpercent.indexIn( line ) != -1 )
Expand Down Expand Up @@ -2654,7 +2660,7 @@ QgsGrassModuleGdalInput::QgsGrassModuleGdalInput(
{
if ( mTitle.isEmpty() )
{
mTitle = tr("OGR/PostGIS/GDAL Input");
mTitle = tr( "OGR/PostGIS/GDAL Input" );
}
adjustTitle();

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

mLayerKey = qdesc.attribute( "layer" );
if ( mLayerKey.isNull() || mLayerKey.length() == 0 ) {
if ( mLayerKey.isNull() || mLayerKey.length() == 0 )
{
QMessageBox::warning( 0, tr( "Warning" ), tr( "'layer' attribute in field tag with key= %1 is missing." ).arg( mKey ) );
} else {
}
else
{
QgsGrassModuleItem *item = mModuleStandardOptions->itemByKey( mLayerKey );
// TODO check type
if ( item )
Expand Down

0 comments on commit 987a9b6

Please sign in to comment.