Skip to content
Permalink
Browse files

indentation update with a few fixed warnings

  • Loading branch information
jef-n committed Jul 25, 2012
1 parent 42aed66 commit b64b3fc812b98304a862b2ddd67f7eb3cddba813
@@ -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++ )
{
@@ -53,10 +53,10 @@ QgsDecorationItem::~QgsDecorationItem()

}

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

void QgsDecorationItem::projectRead()
@@ -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 ) );
}
@@ -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();
}
}
@@ -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;

@@ -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" ) );
}
}

@@ -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 ) )
@@ -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();
@@ -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;
@@ -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 ) )
@@ -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 )
@@ -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,
@@ -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 ) )
@@ -1582,6 +1582,6 @@ void QgsRasterLayerProperties::updatePipeItems()
flags |= ( Qt::ItemFlags )~Qt::ItemIsUserCheckable;
}
item->setFlags( flags );
*/
#endif
}
}
@@ -1008,7 +1008,7 @@ void QgsVectorLayerProperties::saveStyleAsMenuTriggered( QAction *action )
if ( index < 0 )
return;

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

void QgsVectorLayerProperties::saveStyleAs( StyleType styleType )
@@ -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;
@@ -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:

@@ -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,
@@ -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 );
@@ -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() );
@@ -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" );
}
@@ -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;
}

@@ -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;
@@ -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 )
{
@@ -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)

@@ -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
@@ -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; }
@@ -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,
@@ -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;
}
@@ -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;
}
@@ -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
@@ -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 );

@@ -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;

@@ -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;

0 comments on commit b64b3fc

Please sign in to comment.
You can’t perform that action at this time.