Skip to content

Commit

Permalink
fix warnings and indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 15, 2012
1 parent 2cf25a5 commit 6b9d5a7
Show file tree
Hide file tree
Showing 25 changed files with 82 additions and 62 deletions.
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposer.cpp
Expand Up @@ -240,7 +240,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
setTabPosition( Qt::AllDockWidgetAreas, QTabWidget::North );
mGeneralDock = new QDockWidget( tr( "Composition" ), this );
mGeneralDock->setObjectName( "CompositionDock" );
mItemDock = new QDockWidget( tr( "Item Properties"), this );
mItemDock = new QDockWidget( tr( "Item Properties" ), this );
mItemDock->setObjectName( "ItemDock" );
mUndoDock = new QDockWidget( tr( "Command history" ), this );
mUndoDock->setObjectName( "CommandDock" );
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposermap.h
Expand Up @@ -370,7 +370,7 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
void drawGrid( QPainter* p );
/**Draw coordinates for mGridAnnotationType Coordinate
@param p drawing painter
@param hLines horizontal coordinate lines in item coordinates
@param hLines horizontal coordinate lines in item coordinates
@param vLines vertical coordinate lines in item coordinates*/
void drawCoordinateAnnotations( QPainter* p, const QList< QPair< double, QLineF > >& hLines, const QList< QPair< double, QLineF > >& vLines );
void drawCoordinateAnnotation( QPainter* p, const QPointF& pos, QString annotationString );
Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/feature.cpp
Expand Up @@ -913,7 +913,7 @@ namespace pal
tmp = tmp->getNextPart();
}

double angle_diff_avg = f->labelInfo->char_num > 1 ? (angle_diff / ( f->labelInfo->char_num - 1 )) : 0; // <0, pi> but pi/8 is much already
double angle_diff_avg = f->labelInfo->char_num > 1 ? ( angle_diff / ( f->labelInfo->char_num - 1 ) ) : 0; // <0, pi> but pi/8 is much already
double cost = angle_diff_avg / 100; // <0, 0.031 > but usually <0, 0.003 >
if ( cost < 0.0001 ) cost = 0.0001;

Expand Down
20 changes: 10 additions & 10 deletions src/core/qgsdataitem.cpp
Expand Up @@ -150,14 +150,14 @@ const QIcon &QgsZipItem::iconZip()


QgsDataItem::QgsDataItem( QgsDataItem::Type type, QgsDataItem* parent, QString name, QString path )
// Do not pass parent to QObject, Qt would delete this when parent is deleted
// Do not pass parent to QObject, Qt would delete this when parent is deleted
: QObject(), mType( type ), mParent( parent ), mPopulated( false ), mName( name ), mPath( path )
{
}

QgsDataItem::~QgsDataItem()
QgsDataItem::~QgsDataItem()
{
QgsDebugMsg( "mName = " + mName + " mPath = " + mPath);
QgsDebugMsg( "mName = " + mName + " mPath = " + mPath );
}

// TODO: This is copy from QgisApp, bad
Expand Down Expand Up @@ -297,14 +297,14 @@ QgsDataItem * QgsDataItem::removeChildItem( QgsDataItem * child )
mChildren.remove( i );
emit endRemoveItems();
disconnect( child, SIGNAL( beginInsertItems( QgsDataItem*, int, int ) ),
this, SLOT( emitBeginInsertItems( QgsDataItem*, int, int ) ) );
this, SLOT( emitBeginInsertItems( QgsDataItem*, int, int ) ) );
disconnect( child, SIGNAL( endInsertItems() ),
this, SLOT( emitEndInsertItems() ) );
this, SLOT( emitEndInsertItems() ) );
disconnect( child, SIGNAL( beginRemoveItems( QgsDataItem*, int, int ) ),
this, SLOT( emitBeginRemoveItems( QgsDataItem*, int, int ) ) );
this, SLOT( emitBeginRemoveItems( QgsDataItem*, int, int ) ) );
disconnect( child, SIGNAL( endRemoveItems() ),
this, SLOT( emitEndRemoveItems() ) );
child->setParent(0);
this, SLOT( emitEndRemoveItems() ) );
child->setParent( 0 );
return child;
}

Expand Down Expand Up @@ -414,10 +414,10 @@ QgsDataCollectionItem::QgsDataCollectionItem( QgsDataItem* parent, QString name,

QgsDataCollectionItem::~QgsDataCollectionItem()
{
QgsDebugMsg( "Entered");
QgsDebugMsg( "Entered" );
foreach( QgsDataItem* i, mChildren )
{
QgsDebugMsg( QString("delete child = 0x%0").arg((qlonglong)i,8,16,QLatin1Char('0')) );
QgsDebugMsg( QString( "delete child = 0x%0" ).arg(( qlonglong )i, 8, 16, QLatin1Char( '0' ) ) );
delete i;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmessageoutput.cpp
Expand Up @@ -67,7 +67,7 @@ void QgsMessageOutputConsole::showMessage( bool )
{
mMessage.replace( "<br>", "\n" );
mMessage.replace( "&nbsp;", " " );
mMessage.replace( QRegExp("</?[^>]+>"), "" );
mMessage.replace( QRegExp( "</?[^>]+>" ), "" );
}
QgsMessageLog::logMessage( mMessage, mTitle.isNull() ? QObject::tr( "Console" ) : mTitle );
emit destroyed();
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsowsconnection.h
Expand Up @@ -47,6 +47,7 @@ class QgsOWSConnection : public QObject
/**
* Constructor
* @param theService service name: WMS,WFS,WCS
* @param theConnName connection name
*/
QgsOWSConnection( const QString & theService, const QString & theConnName );
//! Destructor
Expand Down
24 changes: 20 additions & 4 deletions src/core/raster/qgsrasterrenderer.h
Expand Up @@ -89,26 +89,42 @@ class CORE_EXPORT QgsRasterRenderer
inline double readValue( void *data, QgsRasterDataProvider::DataType type, int index );

/**Start reading of raster band. Raster data can then be retrieved by calling readNextRasterPart until it returns false.
@param bandNumer number of raster band to read
@param bandNumber number of raster band to read
@param viewPort describes raster position on screen
@param mapToPixel transform map to pixel
@param oversamplingX out: oversampling rate in x-direction
@param oversamplingY out: oversampling rate in y-direction*/
void startRasterRead( int bandNumber, QgsRasterViewPort* viewPort, const QgsMapToPixel* mapToPixel, double& oversamplingX, double& oversamplingY );
/**Fetches next part of raster data
@param bandNumber number of raster band to read
@param oversamplingX oversampling rate in x-direction
@param oversamplingY oversampling rate in y-direction
@param viewPort view port
@param nCols number of columns on output device
@param nRows number of rows on output device
@param nColsRaster number of raster columns (different to nCols if oversamplingX != 1.0)
@param nRowsRaster number of raster rows (different to nRows if oversamplingY != 0)*/
@param nRowsRaster number of raster rows (different to nRows if oversamplingY != 0)
@param rasterData raster data
@param topLeftCol Left position relative to left border of viewport
@param topLeftRow Top position relative to top border of viewport*/
bool readNextRasterPart( int bandNumber, double oversamplingX, double oversamplingY, QgsRasterViewPort* viewPort, int& nCols, int& nRows,
int& nColsRaster, int& nRowsRaster, void** rasterData, int& topLeftCol, int& topLeftRow );
/**Draws raster part
@param p the painter
@param viewPort view port
@param img image
@param topLeftCol Left position relative to left border of viewport
@param topLeftRow Top position relative to top border of viewport*/
@param topLeftRow Top position relative to top border of viewport
@param nCols number of columns
@param nRows number of rows
@param oversamplingX oversampling rate in x-direction
@param oversamplingY oversampling rate in y-direction
*/
void drawImage( QPainter* p, QgsRasterViewPort* viewPort, const QImage& img, int topLeftCol, int topLeftRow,
int nCols, int nRows, double oversamplingX, double oversamplingY ) const;
void stopRasterRead( int bandNumber );

/**Write upper class info into <rasterrenderer> element (called by writeXML method of subclasses)*/
/**Write upper class info into rasterrenderer element (called by writeXML method of subclasses)*/
void _writeXML( QDomDocument& doc, QDomElement& rasterRendererElem ) const;


Expand Down
1 change: 1 addition & 0 deletions src/core/raster/qgsrasterresampler.h
Expand Up @@ -26,6 +26,7 @@ class QImage;
class QgsRasterResampler
{
public:
virtual ~QgsRasterResampler() {}
virtual void resample( const QImage& srcImage, QImage& dstImage ) = 0;
virtual QString type() const = 0;
};
Expand Down
4 changes: 2 additions & 2 deletions src/core/symbology-ng/qgsrulebasedrendererv2.cpp
Expand Up @@ -828,8 +828,8 @@ void QgsRuleBasedRendererV2::refineRuleRanges( QgsRuleBasedRendererV2::Rule* ini
// TODO: have a possibility to construct expressions directly as a parse tree to avoid loss of precision
QString attr = QgsExpression::quotedColumnRef( r->classAttribute() );
QString filter = QString( "%1 >= %2 AND %1 <= %3" ).arg( attr )
.arg( QString::number( rng.lowerValue(), 'f', 4 ) )
.arg( QString::number( rng.upperValue(), 'f', 4 ) );
.arg( QString::number( rng.lowerValue(), 'f', 4 ) )
.arg( QString::number( rng.upperValue(), 'f', 4 ) );
QString label = filter;
initialRule->appendChild( new Rule( rng.symbol()->clone(), 0, 0, filter, label ) );
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/attributetable/qgsattributetablemodel.cpp
Expand Up @@ -168,7 +168,7 @@ void QgsAttributeTableModel::attributeDeleted( int idx )
{
QgsFeatureId fid = rowToId( row );

if( !mFeatureMap.contains( fid ) )
if ( !mFeatureMap.contains( fid ) )
continue;

mFeatureMap[ fid ].deleteAttribute( idx );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsowssourceselect.cpp
Expand Up @@ -379,7 +379,7 @@ void QgsOWSSourceSelect::addClicked()
QgsDebugMsg( "entered" );
}

void QgsOWSSourceSelect::enableLayersForCrs( QTreeWidgetItem *item )
void QgsOWSSourceSelect::enableLayersForCrs( QTreeWidgetItem * )
{
}

Expand Down
18 changes: 9 additions & 9 deletions src/plugins/georeferencer/qgsgeorefplugingui.cpp
Expand Up @@ -1030,19 +1030,19 @@ void QgsGeorefPluginGui::setupConnections()

void QgsGeorefPluginGui::removeOldLayer()
{
// delete layer (and don't signal it as it's our private layer)
if ( mLayer )
{
QgsMapLayerRegistry::instance()->removeMapLayers(
( QStringList() << mLayer->id() ), false );
mLayer = NULL;
}
mCanvas->refresh();
// delete layer (and don't signal it as it's our private layer)
if ( mLayer )
{
QgsMapLayerRegistry::instance()->removeMapLayers(
( QStringList() << mLayer->id() ), false );
mLayer = NULL;
}
mCanvas->refresh();
}

void QgsGeorefPluginGui::updateIconTheme( QString theme )
{
Q_UNUSED(theme);
Q_UNUSED( theme );
// File actions
mActionOpenRaster->setIcon( getThemeIcon( "/mActionOpenRaster.png" ) );
mActionStartGeoref->setIcon( getThemeIcon( "/mActionStartGeoref.png" ) );
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/georeferencer/qgsgeorefplugingui.h
Expand Up @@ -114,7 +114,7 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas

bool updateGeorefTransform();

void updateIconTheme( QString theme);
void updateIconTheme( QString theme );

private:
enum SaveGCPs
Expand Down
1 change: 1 addition & 0 deletions src/providers/gdal/qgswcscapabilities.cpp
Expand Up @@ -501,6 +501,7 @@ void QgsWcsCapabilities::parseContentMetadata( QDomElement const & e, QgsWcsCove

void QgsWcsCapabilities::parseCoverageOfferingBrief( QDomElement const & e, QgsWcsCoverageSummary &coverageSummary, QgsWcsCoverageSummary *parent )
{
Q_UNUSED( parent );
QgsDebugMsg( "Entered" );
coverageSummary.orderId = ++mCoverageCount;

Expand Down
2 changes: 1 addition & 1 deletion src/providers/gdal/qgswcssourceselect.cpp
Expand Up @@ -233,7 +233,7 @@ QStringList QgsWCSSourceSelect::selectedLayersCRSs()
return c->supportedCrs;
}

void QgsWCSSourceSelect::enableLayersForCrs( QTreeWidgetItem *item )
void QgsWCSSourceSelect::enableLayersForCrs( QTreeWidgetItem * )
{
// TODO: I am not convinced to disable layers according to selected CRS
}
18 changes: 9 additions & 9 deletions src/providers/mssql/qgsmssqlprovider.cpp
Expand Up @@ -605,9 +605,9 @@ void QgsMssqlProvider::select( QgsAttributeList fetchAttributes,
if ( !mSqlWhereClause.isEmpty() )
{
if ( rect.isEmpty() )
mStatement += " where (" + mSqlWhereClause + ")";
mStatement += " where (" + mSqlWhereClause + ")";
else
mStatement += " and (" + mSqlWhereClause + ")";
mStatement += " and (" + mSqlWhereClause + ")";
}

mFetchGeom = fetchGeometry;
Expand Down Expand Up @@ -638,7 +638,7 @@ QVariant QgsMssqlProvider::minimumValue( int index )
.arg( fld.name() );

if ( !mSchemaName.isEmpty() )
sql += "[" + mSchemaName + "].";
sql += "[" + mSchemaName + "].";

sql += "[" + mTableName + "]";

Expand Down Expand Up @@ -676,7 +676,7 @@ QVariant QgsMssqlProvider::maximumValue( int index )
.arg( fld.name() );

if ( !mSchemaName.isEmpty() )
sql += "[" + mSchemaName + "].";
sql += "[" + mSchemaName + "].";

sql += "[" + mTableName + "]";

Expand Down Expand Up @@ -712,18 +712,18 @@ void QgsMssqlProvider::uniqueValues( int index, QList<QVariant> &uniqueValues, i

// get the field name
QgsField fld = mAttributeFields[ index ];
QString sql = QString( "select distinct ");
if (limit > 0)
QString sql = QString( "select distinct " );

if ( limit > 0 )
{
sql += QString( " top %1 " ).arg( limit );
}

sql += QString( "[%1] from " )
.arg( fld.name() );
.arg( fld.name() );

if ( !mSchemaName.isEmpty() )
sql += "[" + mSchemaName + "].";
sql += "[" + mSchemaName + "].";

sql += "[" + mTableName + "]";

Expand Down
5 changes: 3 additions & 2 deletions src/providers/ows/qgsowsdataitems.cpp
Expand Up @@ -219,7 +219,7 @@ static QStringList wildcards = QStringList();

QGISEXTERN int dataCapabilities()
{
return QgsDataProvider::Net;
return QgsDataProvider::Net;
}

QGISEXTERN QgsDataItem * dataItem( QString thePath, QgsDataItem* parentItem )
Expand All @@ -228,12 +228,13 @@ QGISEXTERN QgsDataItem * dataItem( QString thePath, QgsDataItem* parentItem )
{
return new QgsOWSRootItem( parentItem, "OWS", "ows:" );
}

return 0;
}

//QGISEXTERN QgsOWSSourceSelect * selectWidget( QWidget * parent, Qt::WFlags fl )
QGISEXTERN QDialog * selectWidget( QWidget * parent, Qt::WFlags fl )
{
Q_UNUSED( parent );
//return new QgsOWSSourceSelect( parent, fl );
return 0;
}
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -2872,7 +2872,7 @@ bool QgsPostgresProvider::getGeometryDetails()
mEnabledCapabilities &= ~( QgsVectorDataProvider::ChangeGeometries | QgsVectorDataProvider::AddFeatures );
}

QgsDebugMsg( QString( "Feature type name is %1" ).arg( QGis::qgisFeatureTypes[ geometryType() ] ) );
QgsDebugMsg( QString( "Feature type name is %1" ).arg( QGis::qgisFeatureTypes[ geometryType()] ) );
QgsDebugMsg( QString( "Geometry is geography %1" ).arg( mIsGeography ) );

return mValid;
Expand Down
4 changes: 2 additions & 2 deletions src/providers/wfs/qgswfsdataitems.cpp
Expand Up @@ -55,7 +55,7 @@ QVector<QgsDataItem*> QgsWFSConnectionItem::createChildren()

QString encodedUri = mPath;
QgsDataSourceURI uri;
uri.setEncodedUri ( encodedUri );
uri.setEncodedUri( encodedUri );
QgsDebugMsg( "encodedUri = " + encodedUri );

mCapabilities = new QgsWFSCapabilities( encodedUri );
Expand Down Expand Up @@ -155,7 +155,7 @@ QVector<QgsDataItem*> QgsWFSRootItem::createChildren()
{
QgsOWSConnection connection( "WF", connName );
QgsDataItem * conn = new QgsWFSConnectionItem( this, connName, connection.uri().encodedUri() );
conn->setIcon ( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
conn->setIcon( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
connections.append( conn );
}
return connections;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmsconnection.cpp
Expand Up @@ -103,7 +103,7 @@ QgsWMSConnection::QgsWMSConnection( QString theConnName ) :
mUri.setParam( "InvertAxisOrientation", "1" );
}

if( !connArgs.isEmpty() )
if ( !connArgs.isEmpty() )
{
connArgs.prepend( "ignoreUrl=" );

Expand Down
16 changes: 8 additions & 8 deletions src/providers/wms/qgswmsdataitems.cpp
Expand Up @@ -42,23 +42,23 @@ QVector<QgsDataItem*> QgsWMSConnectionItem::createChildren()

QString encodedUri = mPath;
QgsDataSourceURI uri;
uri.setEncodedUri ( encodedUri );
/*
if ( mPath.contains ( "url=" ) )
uri.setEncodedUri( encodedUri );
#if 0
if ( mPath.contains( "url=" ) )
{
encodedUri = mPath;
uri.setEncodedUri ( encodedUri );
uri.setEncodedUri( encodedUri );
}
else
{
QgsWMSConnection connection( mName );
uri = connection.uri();
encodedUri = uri.encodedUri();
}
*/
#endif
QgsDebugMsg( "encodedUri = " + encodedUri );

QgsWmsProvider *wmsProvider = new QgsWmsProvider ( encodedUri );
QgsWmsProvider *wmsProvider = new QgsWmsProvider( encodedUri );
if ( !wmsProvider ) return children;

// Attention: supportedLayers() gives tree leafes, not top level
Expand Down Expand Up @@ -100,7 +100,7 @@ bool QgsWMSConnectionItem::equal( const QgsDataItem *other )
{
return false;
}

return ( mPath == o->mPath && mName == o->mName );
}

Expand Down Expand Up @@ -240,7 +240,7 @@ QVector<QgsDataItem*>QgsWMSRootItem::createChildren()
QgsWMSConnection connection( connName );
QgsDataItem * conn = new QgsWMSConnectionItem( this, connName, connection.uri().encodedUri() );

conn->setIcon ( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
conn->setIcon( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
connections.append( conn );
}
return connections;
Expand Down

0 comments on commit 6b9d5a7

Please sign in to comment.