Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Sep 21, 2012
1 parent 3e08931 commit 413e9dc
Show file tree
Hide file tree
Showing 18 changed files with 129 additions and 128 deletions.
75 changes: 38 additions & 37 deletions src/app/legend/qgsapplegendinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ void QgsAppLegendInterface::updateIndex( QModelIndex oldIndex, QModelIndex newIn

void QgsAppLegendInterface::setGroupExpanded( int groupIndex, bool expand )
{
QTreeWidgetItem * item = getItem (groupIndex);
if ( !item )
{
return;
}
QTreeWidgetItem * item = getItem( groupIndex );
if ( !item )
{
return;
}

item->setExpanded(expand);
item->setExpanded( expand );
}

void QgsAppLegendInterface::setGroupVisible( int groupIndex, bool visible )
Expand All @@ -82,29 +82,30 @@ void QgsAppLegendInterface::setGroupVisible( int groupIndex, bool visible )
return;
}

Qt::CheckState state = visible ? Qt::Checked : Qt::Unchecked;
getItem (groupIndex)->setCheckState( 0, state );
Qt::CheckState state = visible ? Qt::Checked : Qt::Unchecked;
getItem( groupIndex )->setCheckState( 0, state );
}

QTreeWidgetItem *QgsAppLegendInterface::getItem(int itemIndex)
QTreeWidgetItem *QgsAppLegendInterface::getItem( int itemIndex )
{
int itemCount = 0;
for (QTreeWidgetItem* theItem = mLegend->firstItem(); theItem; theItem = mLegend->nextItem( theItem ) )
{
QgsLegendItem* legendItem = dynamic_cast<QgsLegendItem *>( theItem );
if (legendItem->type() == QgsLegendItem::LEGEND_GROUP) {
if (itemCount == itemIndex)
{
return theItem;
}
else
{
itemCount = itemCount + 1;
}
}
}
int itemCount = 0;
for ( QTreeWidgetItem* theItem = mLegend->firstItem(); theItem; theItem = mLegend->nextItem( theItem ) )
{
QgsLegendItem* legendItem = dynamic_cast<QgsLegendItem *>( theItem );
if ( legendItem->type() == QgsLegendItem::LEGEND_GROUP )
{
if ( itemCount == itemIndex )
{
return theItem;
}
else
{
itemCount = itemCount + 1;
}
}
}

return NULL;
return NULL;
}

void QgsAppLegendInterface::setLayerVisible( QgsMapLayer * ml, bool visible )
Expand All @@ -128,24 +129,24 @@ QList< GroupLayerInfo > QgsAppLegendInterface::groupLayerRelationship()

bool QgsAppLegendInterface::groupExists( int groupIndex )
{
QTreeWidgetItem * item = getItem (groupIndex);
QgsLegendItem* legendItem = dynamic_cast<QgsLegendItem *>( item );
QTreeWidgetItem * item = getItem( groupIndex );
QgsLegendItem* legendItem = dynamic_cast<QgsLegendItem *>( item );

if ( !legendItem )
{
return false;
}
if ( !legendItem )
{
return false;
}

return legendItem->type() == QgsLegendItem::LEGEND_GROUP;
return legendItem->type() == QgsLegendItem::LEGEND_GROUP;
}

bool QgsAppLegendInterface::isGroupExpanded( int groupIndex )
{
QTreeWidgetItem * item = getItem (groupIndex);
if ( !item )
{
return false;
}
QTreeWidgetItem * item = getItem( groupIndex );
if ( !item )
{
return false;
}

return item->isExpanded();
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgsapplegendinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ class QgsAppLegendInterface : public QgsLegendInterface

//! Pointer to QgsLegend object
QgsLegend *mLegend;
QTreeWidgetItem *getItem(int itemIndex);
QTreeWidgetItem *getItem( int itemIndex );
};

#endif //QGSLEGENDAPPIFACE_H
28 changes: 14 additions & 14 deletions src/core/qgsmaprenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ class QgsDiagramLayerSettings;

class CORE_EXPORT QgsLabelPosition
{
public:
QgsLabelPosition( int id, double r, const QVector< QgsPoint >& corners, const QgsRectangle& rect, double w, double h, const QString& layer, bool upside_down, bool diagram = false, bool pinned = false ):
featureId( id ), rotation( r ), cornerPoints( corners ), labelRect( rect ), width( w ), height( h ), layerID( layer ), upsideDown( upside_down ), isDiagram( diagram ), isPinned( pinned ) {}
QgsLabelPosition(): featureId( -1 ), rotation( 0 ), labelRect( QgsRectangle() ), width( 0 ), height( 0 ), layerID( "" ), upsideDown( false ), isDiagram( false ), isPinned( false ) {}
int featureId;
double rotation;
QVector< QgsPoint > cornerPoints;
QgsRectangle labelRect;
double width;
double height;
QString layerID;
bool upsideDown;
bool isDiagram;
bool isPinned;
public:
QgsLabelPosition( int id, double r, const QVector< QgsPoint >& corners, const QgsRectangle& rect, double w, double h, const QString& layer, bool upside_down, bool diagram = false, bool pinned = false ):
featureId( id ), rotation( r ), cornerPoints( corners ), labelRect( rect ), width( w ), height( h ), layerID( layer ), upsideDown( upside_down ), isDiagram( diagram ), isPinned( pinned ) {}
QgsLabelPosition(): featureId( -1 ), rotation( 0 ), labelRect( QgsRectangle() ), width( 0 ), height( 0 ), layerID( "" ), upsideDown( false ), isDiagram( false ), isPinned( false ) {}
int featureId;
double rotation;
QVector< QgsPoint > cornerPoints;
QgsRectangle labelRect;
double width;
double height;
QString layerID;
bool upsideDown;
bool isDiagram;
bool isPinned;
};

/** Labeling engine interface.
Expand Down
4 changes: 2 additions & 2 deletions src/core/raster/qgsmultibandcolorrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,11 @@ void * QgsMultiBandColorRenderer::readBlock( int bandNo, QgsRectangle const & e
if ( !bandData[*bandIt] )
{
// We should free the alloced mem from block().
QgsDebugMsg("No input band" );
QgsDebugMsg( "No input band" );
bandIt--;
for ( ; bandIt != bands.constBegin(); bandIt-- )
{
VSIFree( bandData[*bandIt] );
VSIFree( bandData[*bandIt] );
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgspalettedrasterrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void * QgsPalettedRasterRenderer::readBlock( int bandNo, QgsRectangle const & e
void* rasterData = mInput->block( bandNo, extent, width, height );
if ( ! rasterData )
{
QgsDebugMsg("No raster data!" );
QgsDebugMsg( "No raster data!" );
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgssinglebandcolordatarenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void * QgsSingleBandColorDataRenderer::readBlock( int bandNo, QgsRectangle cons
void* rasterData = mInput->block( bandNo, extent, width, height );
if ( ! rasterData )
{
QgsDebugMsg("No raster data!" );
QgsDebugMsg( "No raster data!" );
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgsprojectparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ void QgsProjectParser::describeFeatureType( const QString& aTypeName, QDomElemen
QMap< QString, QMap< int, QString > > aliasInfo = layerAliasInfo();
QMap< QString, QSet<QString> > hiddenAttrs = hiddenAttributes();

foreach( const QDomElement &elem, mProjectLayerElements )
foreach ( const QDomElement &elem, mProjectLayerElements )
{
QString type = elem.attribute( "type" );
if ( type == "vector" )
Expand Down
2 changes: 1 addition & 1 deletion src/mapserver/qgssldparser.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class QgsSLDParser: public QgsConfigParser
void layersAndStylesCapabilities( QDomElement& parentElement, QDomDocument& doc ) const;

void featureTypeList( QDomElement &, QDomDocument & ) const {};

void describeFeatureType( const QString& aTypeName, QDomElement& parentElement, QDomDocument& doc ) const {};

/**Returns number of layers in configuration*/
Expand Down
10 changes: 5 additions & 5 deletions src/mapserver/qgswfsserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ QDomDocument QgsWFSServer::describeFeatureType()
{
typeName = "";
}
mConfigParser->describeFeatureType( typeName, schemaElement, doc);
mConfigParser->describeFeatureType( typeName, schemaElement, doc );
return doc;
}

Expand Down Expand Up @@ -511,7 +511,7 @@ void QgsWFSServer::startGetFeature( QgsRequestHandler& request, const QString& f
if ( format == "GeoJSON" )
{
fcString = "{\"type\": \"FeatureCollection\",\n";
fcString += " \"bbox\": [ "+ QString::number( rect->xMinimum(), 'f' ) +", "+ QString::number( rect->yMinimum(), 'f' ) +", "+ QString::number( rect->xMaximum(), 'f' ) +", "+ QString::number( rect->yMaximum(), 'f' ) +"],\n";
fcString += " \"bbox\": [ " + QString::number( rect->xMinimum(), 'f' ) + ", " + QString::number( rect->yMinimum(), 'f' ) + ", " + QString::number( rect->xMaximum(), 'f' ) + ", " + QString::number( rect->yMaximum(), 'f' ) + "],\n";
fcString += " \"features\": [\n";
result = fcString.toUtf8();
request.startGetFeatureResponse( &result, format );
Expand Down Expand Up @@ -599,7 +599,7 @@ void QgsWFSServer::startGetFeature( QgsRequestHandler& request, const QString& f
fcString += " xmlns=\"http://www.opengis.net/wfs\"";
fcString += " xmlns:wfs=\"http://www.opengis.net/wfs\"";
fcString += " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"";
fcString += " xsi:schemaLocation=\"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd http://www.opengis.net/gml "+ hrefString.replace( "&", "&amp;" ) +"\"";
fcString += " xsi:schemaLocation=\"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd http://www.opengis.net/gml " + hrefString.replace( "&", "&amp;" ) + "\"";
fcString += " xmlns:ogc=\"http://www.opengis.net/ogc\"";
fcString += " xmlns:gml=\"http://www.opengis.net/gml\"";
fcString += " xmlns:ows=\"http://www.opengis.net/ows\"";
Expand Down Expand Up @@ -691,7 +691,7 @@ QString QgsWFSServer::createFeatureGeoJSON( QgsFeature* feat, QgsCoordinateRefer
{
QgsRectangle box = geom->boundingBox();

fStr += " \"bbox\": [ "+ QString::number( box.xMinimum(), 'f' ) +", "+ QString::number( box.yMinimum(), 'f' ) +", "+ QString::number( box.xMaximum(), 'f' ) +", "+ QString::number( box.yMaximum(), 'f' ) +"],\n";
fStr += " \"bbox\": [ " + QString::number( box.xMinimum(), 'f' ) + ", " + QString::number( box.yMinimum(), 'f' ) + ", " + QString::number( box.xMaximum(), 'f' ) + ", " + QString::number( box.yMaximum(), 'f' ) + "],\n";

fStr += " \"geometry\": ";
fStr += geom->exportToGeoJSON();
Expand Down Expand Up @@ -1020,7 +1020,7 @@ QDomElement QgsWFSServer::createCoordinateElem( const QVector<QgsPoint> points,
{
coordString += " ";
}
coordString += QString::number( pointIt->x(), 'f');
coordString += QString::number( pointIt->x(), 'f' );
coordString += ",";
coordString += QString::number( pointIt->y(), 'f' );
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/qgsgcplistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void QgsGCPListModel::updateModel()
// interested in the residual in this direction
if ( mGeorefTransform->transformWorldToRaster( p->mapCoords(), dst ) )
{
dX = ( dst.x() - pixel.x() );
dX = ( dst.x() - pixel.x() );
dY = -( dst.y() - pixel.y() );
}
}
Expand Down
22 changes: 11 additions & 11 deletions src/plugins/georeferencer/qgsgeorefplugingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,10 +632,10 @@ void QgsGeorefPluginGui::showGeorefConfigDialog()
// Histogram stretch slots
void QgsGeorefPluginGui::fullHistogramStretch()
{
mLayer->setContrastEnhancementAlgorithm( "StretchToMinimumMaximum" );
mLayer->setMinimumMaximumUsingDataset();
mLayer->setCacheImage( NULL );
mCanvas->refresh();
mLayer->setContrastEnhancementAlgorithm( "StretchToMinimumMaximum" );
mLayer->setMinimumMaximumUsingDataset();
mLayer->setCacheImage( NULL );
mCanvas->refresh();
}

void QgsGeorefPluginGui::localHistogramStretch()
Expand Down Expand Up @@ -863,11 +863,11 @@ void QgsGeorefPluginGui::createActions()
// Histogram stretch
mActionLocalHistogramStretch->setIcon( getThemeIcon( "/mActionLocalHistogramStretch.png" ) );
connect( mActionLocalHistogramStretch, SIGNAL( triggered() ), this, SLOT( localHistogramStretch() ) );
mActionLocalHistogramStretch->setEnabled(false);
mActionLocalHistogramStretch->setEnabled( false );

mActionFullHistogramStretch->setIcon( getThemeIcon( "/mActionFullHistogramStretch.png" ) );
connect( mActionFullHistogramStretch, SIGNAL( triggered() ), this, SLOT( fullHistogramStretch() ) );
mActionFullHistogramStretch->setEnabled(false);
mActionFullHistogramStretch->setEnabled( false );

// Help actions
mActionHelp = new QAction( tr( "Help" ), this );
Expand Down Expand Up @@ -1041,7 +1041,7 @@ void QgsGeorefPluginGui::createStatusBar()
statusBar()->addPermanentWidget( mCoordsLabel, 0 );

mEPSG = createBaseLabelStatus();
mEPSG->setText("EPSG:");
mEPSG->setText( "EPSG:" );
statusBar()->addPermanentWidget( mEPSG, 0 );
}

Expand Down Expand Up @@ -1121,8 +1121,8 @@ void QgsGeorefPluginGui::addRaster( QString file )

mAgainAddRaster = false;

mActionLocalHistogramStretch->setEnabled(true);
mActionFullHistogramStretch->setEnabled(true);
mActionLocalHistogramStretch->setEnabled( true );
mActionFullHistogramStretch->setEnabled( true );

// Status Bar
if ( mGeorefTransform.hasCrs() )
Expand All @@ -1133,8 +1133,8 @@ void QgsGeorefPluginGui::addRaster( QString file )
}
else
{
mEPSG->setText( tr("None") );
mEPSG->setToolTip( tr("Coordinate of image(column/line)") );
mEPSG->setText( tr( "None" ) );
mEPSG->setToolTip( tr( "Coordinate of image(column/line)" ) );
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/plugins/georeferencer/qgsgeoreftransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ void QgsGeorefTransform::selectTransformParametrisation( TransformParametrisatio

void QgsGeorefTransform::setRasterChangeCoords( const QString &fileRaster )
{
mRasterChangeCoords.setRaster( fileRaster );
mRasterChangeCoords.setRaster( fileRaster );
}

bool QgsGeorefTransform::providesAccurateInverseTransformation() const
Expand Down Expand Up @@ -210,13 +210,13 @@ bool QgsGeorefTransform::updateParametersFromGCPs( const std::vector<QgsPoint> &
}
if ( mRasterChangeCoords.hasCrs() )
{
std::vector<QgsPoint> pixelCoordsCorrect = mRasterChangeCoords.getPixelCoords(pixelCoords);
mParametersInitialized = mGeorefTransformImplementation->updateParametersFromGCPs( mapCoords, pixelCoordsCorrect );
pixelCoordsCorrect.clear();
std::vector<QgsPoint> pixelCoordsCorrect = mRasterChangeCoords.getPixelCoords( pixelCoords );
mParametersInitialized = mGeorefTransformImplementation->updateParametersFromGCPs( mapCoords, pixelCoordsCorrect );
pixelCoordsCorrect.clear();
}
else
{
mParametersInitialized = mGeorefTransformImplementation->updateParametersFromGCPs( mapCoords, pixelCoords );
mParametersInitialized = mGeorefTransformImplementation->updateParametersFromGCPs( mapCoords, pixelCoords );
}
return mParametersInitialized;
}
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/georeferencer/qgsgeoreftransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ class QgsGeorefTransform : public QgsGeorefTransformInterface
bool hasCrs() const { return mRasterChangeCoords.hasCrs(); }

//! \returns Coordinates of image
QgsPoint toColumnLine(const QgsPoint &pntMap) { return mRasterChangeCoords.toColumnLine( pntMap ); }
QgsPoint toColumnLine( const QgsPoint &pntMap ) { return mRasterChangeCoords.toColumnLine( pntMap ); }

//! \returns Bounding box of image(transform to coordinate of Map or Image )
QgsRectangle getBoundingBox(const QgsRectangle &rect, bool toPixel) { return mRasterChangeCoords.getBoundingBox( rect, toPixel); }
QgsRectangle getBoundingBox( const QgsRectangle &rect, bool toPixel ) { return mRasterChangeCoords.getBoundingBox( rect, toPixel ); }

//! \brief The transform parametrisation currently in use.
TransformParametrisation transformParametrisation() const;
Expand Down
Loading

0 comments on commit 413e9dc

Please sign in to comment.