Skip to content

Commit 5a0c4cf

Browse files
author
jef
committed
minor updates (indentation, debug output)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9179 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 07eef18 commit 5a0c4cf

File tree

7 files changed

+43
-41
lines changed

7 files changed

+43
-41
lines changed

src/app/qgsrasterlayerproperties.cpp

+21-19
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QWidget *p
135135
//setup custom colormap tab
136136
cboxColorInterpolation->addItem( tr( "Discrete" ) );
137137
cboxColorInterpolation->addItem( tr( "Linear" ) );
138-
cboxColorInterpolation->addItem( tr( "Exact") );
138+
cboxColorInterpolation->addItem( tr( "Exact" ) );
139139
cboxClassificationMode->addItem( tr( "Equal interval" ) );
140140
//cboxClassificationMode->addItem( tr( "Quantiles" ) );
141141

@@ -294,7 +294,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QWidget *p
294294

295295
pbtnExportColorMapToFile->setIcon( QgisApp::getThemeIcon( "/mActionFileSave.png" ) );
296296
pbtnLoadColorMapFromFile->setIcon( QgisApp::getThemeIcon( "/mActionFileOpen.png" ) );
297-
297+
298298
// Only do pyramids if dealing directly with GDAL.
299299
if ( mRasterLayerIsGdal )
300300
{
@@ -2587,10 +2587,12 @@ void QgsRasterLayerProperties::on_mClassifyButton_clicked()
25872587
currentValue += intervalDiff;
25882588
}
25892589
}
2590-
//else if ( cboxClassificationMode->currentText() == tr( "Quantiles" ) )
2591-
//{
2590+
#if 0
2591+
else if ( cboxClassificationMode->currentText() == tr( "Quantiles" ) )
2592+
{
25922593
//todo
2593-
//}
2594+
}
2595+
#endif
25942596

25952597
//hard code color range from blue -> red for now. Allow choice of ramps in future
25962598
int colorDiff = 0;
@@ -2677,7 +2679,7 @@ void QgsRasterLayerProperties::on_pbtnExportColorMapToFile_clicked()
26772679
{
26782680
myOutputStream << "EXACT\n";
26792681
}
2680-
2682+
26812683
int myTopLevelItemCount = mColormapTreeWidget->topLevelItemCount();
26822684
QTreeWidgetItem* myCurrentItem;
26832685
QColor myColor;
@@ -2691,9 +2693,9 @@ void QgsRasterLayerProperties::on_pbtnExportColorMapToFile_clicked()
26912693
myColor = myCurrentItem->background( 1 ).color();
26922694
myOutputStream << myCurrentItem->text( 0 ).toDouble() << ",";
26932695
myOutputStream << myColor.red() << "," << myColor.green() << "," << myColor.blue() << "," << myColor.alpha() << ",";
2694-
if(myCurrentItem->text(2) == "")
2696+
if ( myCurrentItem->text( 2 ) == "" )
26952697
{
2696-
myOutputStream << "Color entry " << i+1 << "\n";
2698+
myOutputStream << "Color entry " << i + 1 << "\n";
26972699
}
26982700
else
26992701
{
@@ -2721,11 +2723,11 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()
27212723
{
27222724
//clear the current tree
27232725
mColormapTreeWidget->clear();
2724-
2726+
27252727
QTextStream myInputStream( &myInputFile );
27262728
QString myInputLine;
27272729
QStringList myInputStringComponents;
2728-
2730+
27292731
//read through the input looking for valid data
27302732
while ( !myInputStream.atEnd() )
27312733
{
@@ -2735,16 +2737,16 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()
27352737
{
27362738
if ( !myInputLine.simplified().startsWith( "#" ) )
27372739
{
2738-
if(myInputLine.contains("INTERPOLATION", Qt::CaseInsensitive))
2740+
if ( myInputLine.contains( "INTERPOLATION", Qt::CaseInsensitive ) )
27392741
{
2740-
myInputStringComponents = myInputLine.split(":");
2741-
if(myInputStringComponents.size() == 2)
2742+
myInputStringComponents = myInputLine.split( ":" );
2743+
if ( myInputStringComponents.size() == 2 )
27422744
{
2743-
if(myInputStringComponents[1].trimmed().toUpper().compare ("INTERPOLATED", Qt::CaseInsensitive) == 0)
2745+
if ( myInputStringComponents[1].trimmed().toUpper().compare( "INTERPOLATED", Qt::CaseInsensitive ) == 0 )
27442746
{
27452747
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Linear" ) ) );
27462748
}
2747-
else if(myInputStringComponents[1].trimmed().toUpper().compare ("DISCRETE", Qt::CaseInsensitive) == 0)
2749+
else if ( myInputStringComponents[1].trimmed().toUpper().compare( "DISCRETE", Qt::CaseInsensitive ) == 0 )
27482750
{
27492751
cboxColorInterpolation->setCurrentIndex( cboxColorInterpolation->findText( tr( "Discrete" ) ) );
27502752
}
@@ -2761,12 +2763,12 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()
27612763
}
27622764
else
27632765
{
2764-
myInputStringComponents = myInputLine.split(",");
2765-
if(myInputStringComponents.size() == 6)
2766+
myInputStringComponents = myInputLine.split( "," );
2767+
if ( myInputStringComponents.size() == 6 )
27662768
{
27672769
QTreeWidgetItem* newItem = new QTreeWidgetItem( mColormapTreeWidget );
27682770
newItem->setText( 0, myInputStringComponents[0] );
2769-
newItem->setBackground( 1, QBrush( QColor::fromRgb(myInputStringComponents[1].toInt(), myInputStringComponents[2].toInt(), myInputStringComponents[3].toInt(), myInputStringComponents[4].toInt()) ) );
2771+
newItem->setBackground( 1, QBrush( QColor::fromRgb( myInputStringComponents[1].toInt(), myInputStringComponents[2].toInt(), myInputStringComponents[3].toInt(), myInputStringComponents[4].toInt() ) ) );
27702772
newItem->setText( 2, myInputStringComponents[5] );
27712773
}
27722774
else
@@ -2779,7 +2781,7 @@ void QgsRasterLayerProperties::on_pbtnLoadColorMapFromFile_clicked()
27792781
}
27802782
myLineCounter++;
27812783
}
2782-
2784+
27832785

27842786
if ( myImportError )
27852787
{

src/core/composer/qgscomposermap.cpp

+17-17
Original file line numberDiff line numberDiff line change
@@ -252,23 +252,23 @@ void QgsComposerMap::resize( double dx, double dy )
252252

253253
void QgsComposerMap::moveContent( double dx, double dy )
254254
{
255-
if(!mDrawing)
256-
{
257-
QRectF itemRect = rect();
258-
double xRatio = dx / itemRect.width();
259-
double yRatio = dy / itemRect.height();
260-
261-
double xMoveMapCoord = mExtent.width() * xRatio;
262-
double yMoveMapCoord = -( mExtent.height() * yRatio );
263-
264-
mExtent.setXMinimum( mExtent.xMin() + xMoveMapCoord );
265-
mExtent.setXMaximum( mExtent.xMax() + xMoveMapCoord );
266-
mExtent.setYMinimum( mExtent.yMin() + yMoveMapCoord );
267-
mExtent.setYMaximum( mExtent.yMax() + yMoveMapCoord );
268-
emit extentChanged();
269-
cache();
270-
update();
271-
}
255+
if ( !mDrawing )
256+
{
257+
QRectF itemRect = rect();
258+
double xRatio = dx / itemRect.width();
259+
double yRatio = dy / itemRect.height();
260+
261+
double xMoveMapCoord = mExtent.width() * xRatio;
262+
double yMoveMapCoord = -( mExtent.height() * yRatio );
263+
264+
mExtent.setXMinimum( mExtent.xMin() + xMoveMapCoord );
265+
mExtent.setXMaximum( mExtent.xMax() + xMoveMapCoord );
266+
mExtent.setYMinimum( mExtent.yMin() + yMoveMapCoord );
267+
mExtent.setYMaximum( mExtent.yMax() + yMoveMapCoord );
268+
emit extentChanged();
269+
cache();
270+
update();
271+
}
272272
}
273273

274274
void QgsComposerMap::setSceneRect( const QRectF& rectangle )

src/core/composer/qgsnumericscalebarstyle.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ QString QgsNumericScaleBarStyle::scaleText() const
8080
if ( composerMap )
8181
{
8282
double scaleDenominator = composerMap->scale();
83-
scaleBarText = "1:" + QString::number(scaleDenominator, 'f', 0);
83+
scaleBarText = "1:" + QString::number( scaleDenominator, 'f', 0 );
8484
}
8585
}
8686
return scaleBarText;

src/core/raster/qgsrasterlayer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ void QgsRasterLayer::drawPalettedSingleBandPseudoColor( QPainter * theQPainter,
17731773
continue;
17741774
}
17751775

1776-
if ( !mRasterShader->generateShadedValue(myPixelValue, &myRedValue, &myGreenValue, &myBlueValue ) )
1776+
if ( !mRasterShader->generateShadedValue( myPixelValue, &myRedValue, &myGreenValue, &myBlueValue ) )
17771777
{
17781778
continue;
17791779
}

src/plugins/dxf2shp_converter/builder.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ void Builder::print_shpObjects()
512512
int dim = shpObjects.size();
513513
int dimTexts = textObjects.size();
514514

515-
QgsDebugMsg( QString( "Number pf primitives: %1" ).arg( dim ) );
515+
QgsDebugMsg( QString( "Number of primitives: %1" ).arg( dim ) );
516516
QgsDebugMsg( QString( "Number of text fields: %1" ).arg( dimTexts ) );
517517

518518
SHPHandle hSHP;

src/plugins/interpolation/DualEdgeTriangulation.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ int DualEdgeTriangulation::addPoint( Point3D* p )
105105
{
106106
if ( p )
107107
{
108-
// QgsDebugMsg( QString("inserting point %1,%2//%3//").arg(mPointVector.count()).arg(p->getX()).arg(p->getY()));
108+
// QgsDebugMsg( QString("inserting point %1,%2//%3//%4").arg(mPointVector.count()).arg(p->getX()).arg(p->getY()).arg(p->getZ()));
109109

110110
//first update the bounding box
111111
if ( mPointVector.count() == 0 )//update bounding box when the first point is inserted

src/plugins/spit/qgsshapefile.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ bool QgsShapeFile::insertLayer( QString dbname, QString schema, QString primary_
414414
OGR_G_SetCoordinateDimension( geom, 2 );
415415
OGR_G_ExportToWkt( geom, &geo_temp );
416416
QString geometry( geo_temp );
417-
CPLFree(geo_temp);
417+
CPLFree( geo_temp );
418418

419419
for ( uint n = 0; n < column_types.size(); n++ )
420420
{

0 commit comments

Comments
 (0)