Skip to content

Commit

Permalink
indentation update with a few fixed warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 25, 2012
1 parent 42aed66 commit b64b3fc
Show file tree
Hide file tree
Showing 24 changed files with 92 additions and 81 deletions.
2 changes: 1 addition & 1 deletion src/app/main.cpp
Expand Up @@ -269,7 +269,7 @@ int main( int argc, char *argv[] )
QgsDebugMsg( QString( "Android: All params stripped" ) );// Param %1" ).arg( argv[0] ) );
//put all QGIS settings in the same place
configpath = QDir::homePath() + QString( "/.qgis/" );
QgsDebugMsg( QString( "Android: configpath set to %1" ).arg(configpath) );
QgsDebugMsg( QString( "Android: configpath set to %1" ).arg( configpath ) );
#elif defined(Q_WS_WIN)
for ( int i = 1; i < argc; i++ )
{
Expand Down
14 changes: 7 additions & 7 deletions src/app/qgsdecorationitem.cpp
Expand Up @@ -53,10 +53,10 @@ QgsDecorationItem::~QgsDecorationItem()

}

void QgsDecorationItem::update()
{
void QgsDecorationItem::update()
{
saveToProject();
QgisApp::instance()->mapCanvas()->refresh();
QgisApp::instance()->mapCanvas()->refresh();
}

void QgsDecorationItem::projectRead()
Expand All @@ -70,11 +70,11 @@ void QgsDecorationItem::saveToProject()
QgsDebugMsg( "Entered" );
QgsProject::instance()->writeEntry( mNameConfig, "/Enabled", mEnabled );
}
void QgsDecorationItem::setName( const char *name )
{
mName = name;
void QgsDecorationItem::setName( const char *name )
{
mName = name;
mNameConfig = name;
mNameConfig.remove( " " );
mNameTranslated = tr( name );
QgsDebugMsg( QString( "name=%1 nameconfig=%2 nametrans=%3").arg(mName).arg(mNameConfig).arg(mNameTranslated) );
QgsDebugMsg( QString( "name=%1 nameconfig=%2 nametrans=%3" ).arg( mName ).arg( mNameConfig ).arg( mNameTranslated ) );
}
30 changes: 15 additions & 15 deletions src/app/qgsmaptoolfreezelabels.cpp
Expand Up @@ -118,12 +118,12 @@ void QgsMapToolFreezeLabels::showFrozenLabels( bool show )
mShowFrozen = show;
if ( mShowFrozen )
{
QgsDebugMsg( QString( "Toggling on frozen label highlighting" ));
QgsDebugMsg( QString( "Toggling on frozen label highlighting" ) );
highlightFrozenLabels();
}
else
{
QgsDebugMsg( QString( "Toggling off frozen label highlighting" ));
QgsDebugMsg( QString( "Toggling off frozen label highlighting" ) );
removeFrozenHighlights();
}
}
Expand All @@ -133,15 +133,15 @@ void QgsMapToolFreezeLabels::updateFrozenLabels()
{
if ( mShowFrozen )
{
QgsDebugMsg( QString( "Updating highlighting due to layer editing mode change" ));
QgsDebugMsg( QString( "Updating highlighting due to layer editing mode change" ) );
mCanvas->refresh();
}
}

void QgsMapToolFreezeLabels::highlightLabel( QgsVectorLayer* vlayer,
const QgsLabelPosition& labelpos,
const QString& id,
const QColor& color )
const QgsLabelPosition& labelpos,
const QString& id,
const QColor& color )
{
QgsRectangle rect = labelpos.labelRect;

Expand All @@ -152,7 +152,7 @@ void QgsMapToolFreezeLabels::highlightLabel( QgsVectorLayer* vlayer,
if ( vlayer->crs() != mRender->destinationCrs() )
{
rect = mRender->mapToLayerCoordinates( vlayer, rect );
QgsDebugMsg( QString( "Reverse transform needed for highlight rectangle" ));
QgsDebugMsg( QString( "Reverse transform needed for highlight rectangle" ) );
}
}

Expand Down Expand Up @@ -209,9 +209,9 @@ void QgsMapToolFreezeLabels::highlightFrozenLabels()
{
mCurrentLabelPos = *it;

if( mCurrentLabelPos.isFrozen )
if ( mCurrentLabelPos.isFrozen )
{
QString labelStringID = QString("%0|%1").arg(mCurrentLabelPos.layerID, QString::number( mCurrentLabelPos.featureId ) );
QString labelStringID = QString( "%0|%1" ).arg( mCurrentLabelPos.layerID, QString::number( mCurrentLabelPos.featureId ) );

// don't highlight again
if ( mHighlights.contains( labelStringID ) )
Expand All @@ -236,7 +236,7 @@ void QgsMapToolFreezeLabels::highlightFrozenLabels()
lblcolor = QColor( 54, 129, 0, 255 );
}

highlightLabel( vlayer, ( *it ), labelStringID, lblcolor);
highlightLabel( vlayer, ( *it ), labelStringID, lblcolor );
}
}
QApplication::restoreOverrideCursor();
Expand All @@ -253,7 +253,7 @@ void QgsMapToolFreezeLabels::removeFrozenHighlights()
QApplication::restoreOverrideCursor();
}

void QgsMapToolFreezeLabels::freezeThawLabels( const QgsRectangle& ext, QMouseEvent * e )
void QgsMapToolFreezeLabels::freezeThawLabels( const QgsRectangle& ext, QMouseEvent * e )
{

bool doThaw = e->modifiers() & Qt::ShiftModifier ? true : false;
Expand Down Expand Up @@ -312,10 +312,10 @@ void QgsMapToolFreezeLabels::freezeThawLabels( const QgsRectangle& ext, QMouseEv
continue;
}

QString labelStringID = QString("%0|%1").arg(mCurrentLabelPos.layerID, QString::number( mCurrentLabelPos.featureId ) );
QString labelStringID = QString( "%0|%1" ).arg( mCurrentLabelPos.layerID, QString::number( mCurrentLabelPos.featureId ) );

// thaw label
if ( mCurrentLabelPos.isFrozen && !doHide && ( doThaw || toggleThawOrFreeze ) )
if ( mCurrentLabelPos.isFrozen && !doHide && ( doThaw || toggleThawOrFreeze ) )
{
// thaw previously frozen label (set attribute table fields to NULL)
if ( freezeThawLabel( vlayer, mCurrentLabelPos, false ) )
Expand Down Expand Up @@ -370,8 +370,8 @@ void QgsMapToolFreezeLabels::freezeThawLabels( const QgsRectangle& ext, QMouseEv
}

bool QgsMapToolFreezeLabels::freezeThawLabel( QgsVectorLayer* vlayer,
const QgsLabelPosition& labelpos,
bool freeze )
const QgsLabelPosition& labelpos,
bool freeze )
{
// skip diagrams
if ( labelpos.isDiagram )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsmaptoolfreezelabels.h
Expand Up @@ -89,7 +89,7 @@ class QgsMapToolFreezeLabels: public QgsMapToolLabel
const QColor& color );

//! Select valid labels to freeze or thaw
void freezeThawLabels( const QgsRectangle& ext, QMouseEvent * e );
void freezeThawLabels( const QgsRectangle& ext, QMouseEvent * e );

//! Freeze or thaw label relative to whether its editable
bool freezeThawLabel( QgsVectorLayer* vlayer,
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsrasterlayerproperties.cpp
Expand Up @@ -1570,7 +1570,7 @@ void QgsRasterLayerProperties::updatePipeItems()
QTreeWidgetItem *item = mPipeTreeWidget->topLevelItem( i );
if ( !item ) continue;
// Checkboxes disabled for now, see above
/*
#if 0
bool on = interface->on();
Qt::ItemFlags flags = item->flags();
if ( pipe->canSetOn( i, !on ) )
Expand All @@ -1582,6 +1582,6 @@ void QgsRasterLayerProperties::updatePipeItems()
flags |= ( Qt::ItemFlags )~Qt::ItemIsUserCheckable;
}
item->setFlags( flags );
*/
#endif
}
}
4 changes: 2 additions & 2 deletions src/app/qgsvectorlayerproperties.cpp
Expand Up @@ -1008,7 +1008,7 @@ void QgsVectorLayerProperties::saveStyleAsMenuTriggered( QAction *action )
if ( index < 0 )
return;

saveStyleAs( (StyleType) index );
saveStyleAs(( StyleType ) index );
}

void QgsVectorLayerProperties::saveStyleAs( StyleType styleType )
Expand All @@ -1029,7 +1029,7 @@ void QgsVectorLayerProperties::saveStyleAs( StyleType styleType )
}

QString myOutputFileName = QFileDialog::getSaveFileName( this, tr( "Save layer properties as style file" ),
myLastUsedDir, format );
myLastUsedDir, format );
if ( myOutputFileName.isNull() ) //dialog canceled
{
return;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsvectorlayerproperties.h
Expand Up @@ -147,7 +147,7 @@ class QgsVectorLayerProperties : public QDialog, private Ui::QgsVectorLayerPrope
private slots:

/** save the style based on selected format from the menu */
void saveStyleAsMenuTriggered( QAction * );
void saveStyleAsMenuTriggered( QAction * );

protected:

Expand Down
2 changes: 1 addition & 1 deletion src/core/gps/qgsqtlocationconnection.cpp
Expand Up @@ -158,7 +158,7 @@ void QgsQtLocationConnection::startGPS()
if ( locationDataSource )
{
locationDataSource->setPreferredPositioningMethods( QGeoPositionInfoSource::SatellitePositioningMethods ); //QGeoPositionInfoSource::AllPositioningMethods
locationDataSource->setUpdateInterval(1000);
locationDataSource->setUpdateInterval( 1000 );
// Whenever the location data source signals that the current
// position is updated, the positionUpdated function is called.
QObject::connect( locationDataSource,
Expand Down
18 changes: 9 additions & 9 deletions src/core/qgsrasterdataprovider.h
Expand Up @@ -451,21 +451,21 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
/**Writes into the provider datasource*/
virtual bool write( void* data, int band, int width, int height, int xOffset, int yOffset )
{
Q_UNUSED( data );
Q_UNUSED( band );
Q_UNUSED( width );
Q_UNUSED( height );
Q_UNUSED( xOffset );
Q_UNUSED( yOffset );
return false;
Q_UNUSED( data );
Q_UNUSED( band );
Q_UNUSED( width );
Q_UNUSED( height );
Q_UNUSED( xOffset );
Q_UNUSED( yOffset );
return false;
}

/** Creates a new dataset with mDataSourceURI
@return true in case of success*/
virtual bool create( const QString& format, int nBands,
QgsRasterDataProvider::DataType type,
QgsRasterDataProvider::DataType type,
int width, int height, double* geoTransform,
const QgsCoordinateReferenceSystem& crs,
const QgsCoordinateReferenceSystem& crs,
QStringList createOptions = QStringList() /*e.v. color table*/ )
{
Q_UNUSED( format );
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsrasterprojector.cpp
Expand Up @@ -34,8 +34,8 @@ QgsRasterProjector::QgsRasterProjector(
, mDestExtent( theDestExtent )
, mExtent( theExtent )
, mDestRows( theDestRows ), mDestCols( theDestCols )
, mMaxSrcXRes( theMaxSrcXRes ), mMaxSrcYRes( theMaxSrcYRes )
, pHelperTop( 0 ), pHelperBottom( 0 )
, mMaxSrcXRes( theMaxSrcXRes ), mMaxSrcYRes( theMaxSrcYRes )
{
QgsDebugMsg( "Entered" );
QgsDebugMsg( "theDestExtent = " + theDestExtent.toString() );
Expand All @@ -53,8 +53,8 @@ QgsRasterProjector::QgsRasterProjector(
, mDestCRS( theDestCRS )
, mCoordinateTransform( theDestCRS, theSrcCRS )
, mExtent( theExtent )
, mMaxSrcXRes( theMaxSrcXRes ), mMaxSrcYRes( theMaxSrcYRes )
, pHelperTop( 0 ), pHelperBottom( 0 )
, mMaxSrcXRes( theMaxSrcXRes ), mMaxSrcYRes( theMaxSrcYRes )
{
QgsDebugMsg( "Entered" );
}
Expand Down
6 changes: 3 additions & 3 deletions src/core/qgsscaleutils.cpp
Expand Up @@ -62,9 +62,9 @@ bool QgsScaleUtils::loadScaleList( const QString &fileName, QStringList &scales,
if ( !doc.setContent( &file, true, &errorStr, &errorLine, &errorColumn ) )
{
errorMessage = QString( "Parse error at line %1, column %2:\n%3" )
.arg( errorLine )
.arg( errorColumn )
.arg( errorStr );
.arg( errorLine )
.arg( errorColumn )
.arg( errorStr );
return false;
}

Expand Down
8 changes: 1 addition & 7 deletions src/core/raster/qgsmultibandcolorrenderer.cpp
Expand Up @@ -103,6 +103,7 @@ QgsRasterRenderer* QgsMultiBandColorRenderer::create( const QDomElement& elem, Q

void * QgsMultiBandColorRenderer::readBlock( int bandNo, QgsRectangle const & extent, int width, int height )
{
Q_UNUSED( bandNo );
if ( !mInput )
{
return 0;
Expand Down Expand Up @@ -136,7 +137,6 @@ void * QgsMultiBandColorRenderer::readBlock( int bandNo, QgsRectangle const & e
transparencyType = ( QgsRasterInterface::DataType )mInput->dataType( mAlphaBand );
}

double oversamplingX = 1.0, oversamplingY = 1.0;
QSet<int> bands;
if ( mRedBand > 0 )
{
Expand Down Expand Up @@ -203,9 +203,6 @@ void * QgsMultiBandColorRenderer::readBlock( int bandNo, QgsRectangle const & e
int redVal = 0;
int greenVal = 0;
int blueVal = 0;
int redDataVal = 0;
int greenDataVal = 0;
int blueDataVal = 0;
QRgb defaultColor = qRgba( 255, 255, 255, 0 );
double currentOpacity = mOpacity; //opacity (between 0 and 1)

Expand All @@ -227,17 +224,14 @@ void * QgsMultiBandColorRenderer::readBlock( int bandNo, QgsRectangle const & e
if ( mRedBand > 0 )
{
redVal = readValue( redData, redType, currentRasterPos );
redDataVal = redVal;
}
if ( mGreenBand > 0 )
{
greenVal = readValue( greenData, greenType, currentRasterPos );
greenDataVal = greenVal;
}
if ( mBlueBand > 0 )
{
blueVal = readValue( blueData, blueType, currentRasterPos );
blueDataVal = blueVal;
}

//apply default color if red, green or blue not in displayable range
Expand Down
4 changes: 2 additions & 2 deletions src/core/raster/qgsrasterfilewriter.h
Expand Up @@ -45,7 +45,7 @@ class CORE_EXPORT QgsRasterFileWriter
int maxTileWidth() const { return mMaxTileWidth; }

void setMaxTileHeight( int h ) { mMaxTileHeight = h; }
int maxTileHeight() const { return mMaxTileHeight; }
int maxTileHeight() const { return mMaxTileHeight; }

// for now not putting createOptions in all methods, use createOptions()
void setCreateOptions( const QStringList& list ) { mCreateOptions = list; }
Expand All @@ -72,7 +72,7 @@ class CORE_EXPORT QgsRasterFileWriter
QgsRasterDataProvider* createPartProvider( const QgsRectangle& extent, int nCols, int iterCols, int iterRows,
int iterLeft, int iterTop,
const QString& outputUrl, int fileIndex, int nBands, QgsRasterInterface::DataType type,
const QgsCoordinateReferenceSystem& crs );
const QgsCoordinateReferenceSystem& crs );

/**Init VRT (for tiled mode) or create global output provider (single-file mode)*/
QgsRasterDataProvider* initOutput( int nCols, int nRows, const QgsCoordinateReferenceSystem& crs, double* geoTransform, int nBands,
Expand Down
21 changes: 21 additions & 0 deletions src/core/raster/qgsrasterinterface.cpp
Expand Up @@ -50,6 +50,12 @@ bool QgsRasterInterface::typeIsNumeric( DataType dataType ) const
case CFloat32:
case CFloat64:
return true;

case UnknownDataType:
case ARGB32:
case ARGB32_Premultiplied:
case TypeCount:
return false;
}
return false;
}
Expand All @@ -61,6 +67,21 @@ bool QgsRasterInterface::typeIsColor( DataType dataType ) const
case ARGB32:
case ARGB32_Premultiplied:
return true;

case UnknownDataType:
case Byte:
case UInt16:
case Int16:
case UInt32:
case Int32:
case Float32:
case CInt16:
case Float64:
case CInt32:
case CFloat32:
case CFloat64:
case TypeCount:
return false;
}
return false;
}
Expand Down
5 changes: 0 additions & 5 deletions src/core/raster/qgsrasterpipe.cpp
Expand Up @@ -129,11 +129,6 @@ bool QgsRasterPipe::set( QgsRasterInterface* theInterface )

if ( !theInterface ) return false;

QgsRasterDataProvider * provider = dynamic_cast<QgsRasterDataProvider *>( theInterface );
QgsRasterRenderer * renderer;
QgsRasterResampleFilter * resampleFilter;
QgsRasterProjector * projector;

Role role = interfaceRole( theInterface );

// We dont know where to place unknown interface
Expand Down
3 changes: 1 addition & 2 deletions src/core/raster/qgsrasterrenderer.h
Expand Up @@ -68,8 +68,7 @@ class CORE_EXPORT QgsRasterRenderer : public QgsRasterInterface
/**Get symbology items if provided by renderer*/
virtual void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const { Q_UNUSED( symbolItems ); }

virtual void writeXML( QDomDocument& doc, QDomElement& parentElem ) const {}

virtual void writeXML( QDomDocument&, QDomElement& ) const {}
/**Sets base class members from xml. Usually called from create() methods of subclasses*/
void readXML( const QDomElement& rendererElem );

Expand Down
1 change: 1 addition & 0 deletions src/core/raster/qgsrasterresamplefilter.cpp
Expand Up @@ -113,6 +113,7 @@ void QgsRasterResampleFilter::setZoomedOutResampler( QgsRasterResampler* r )

void * QgsRasterResampleFilter::readBlock( int bandNo, QgsRectangle const & extent, int width, int height )
{
Q_UNUSED( bandNo );
QgsDebugMsg( "Entered" );
if ( !mInput ) return 0;

Expand Down
2 changes: 0 additions & 2 deletions src/core/raster/qgssinglebandcolordatarenderer.cpp
Expand Up @@ -55,8 +55,6 @@ void * QgsSingleBandColorDataRenderer::readBlock( int bandNo, QgsRectangle cons

bool hasTransparency = usesTransparency();

QgsRasterInterface::DataType rasterType = ( QgsRasterInterface::DataType )mInput->dataType( mBand );

void* rasterData = mInput->block( bandNo, extent, width, height );

currentRasterPos = 0;
Expand Down

0 comments on commit b64b3fc

Please sign in to comment.