Skip to content

Commit 6b9d5a7

Browse files
committedJun 15, 2012
fix warnings and indentation
1 parent 2cf25a5 commit 6b9d5a7

25 files changed

+82
-62
lines changed
 

‎src/app/composer/qgscomposer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ QgsComposer::QgsComposer( QgisApp *qgis, const QString& title )
240240
setTabPosition( Qt::AllDockWidgetAreas, QTabWidget::North );
241241
mGeneralDock = new QDockWidget( tr( "Composition" ), this );
242242
mGeneralDock->setObjectName( "CompositionDock" );
243-
mItemDock = new QDockWidget( tr( "Item Properties"), this );
243+
mItemDock = new QDockWidget( tr( "Item Properties" ), this );
244244
mItemDock->setObjectName( "ItemDock" );
245245
mUndoDock = new QDockWidget( tr( "Command history" ), this );
246246
mUndoDock->setObjectName( "CommandDock" );

‎src/core/composer/qgscomposermap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
370370
void drawGrid( QPainter* p );
371371
/**Draw coordinates for mGridAnnotationType Coordinate
372372
@param p drawing painter
373-
@param hLines horizontal coordinate lines in item coordinates
373+
@param hLines horizontal coordinate lines in item coordinates
374374
@param vLines vertical coordinate lines in item coordinates*/
375375
void drawCoordinateAnnotations( QPainter* p, const QList< QPair< double, QLineF > >& hLines, const QList< QPair< double, QLineF > >& vLines );
376376
void drawCoordinateAnnotation( QPainter* p, const QPointF& pos, QString annotationString );

‎src/core/pal/feature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,7 +913,7 @@ namespace pal
913913
tmp = tmp->getNextPart();
914914
}
915915

916-
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
916+
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
917917
double cost = angle_diff_avg / 100; // <0, 0.031 > but usually <0, 0.003 >
918918
if ( cost < 0.0001 ) cost = 0.0001;
919919

‎src/core/qgsdataitem.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ const QIcon &QgsZipItem::iconZip()
150150

151151

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

158-
QgsDataItem::~QgsDataItem()
158+
QgsDataItem::~QgsDataItem()
159159
{
160-
QgsDebugMsg( "mName = " + mName + " mPath = " + mPath);
160+
QgsDebugMsg( "mName = " + mName + " mPath = " + mPath );
161161
}
162162

163163
// TODO: This is copy from QgisApp, bad
@@ -297,14 +297,14 @@ QgsDataItem * QgsDataItem::removeChildItem( QgsDataItem * child )
297297
mChildren.remove( i );
298298
emit endRemoveItems();
299299
disconnect( child, SIGNAL( beginInsertItems( QgsDataItem*, int, int ) ),
300-
this, SLOT( emitBeginInsertItems( QgsDataItem*, int, int ) ) );
300+
this, SLOT( emitBeginInsertItems( QgsDataItem*, int, int ) ) );
301301
disconnect( child, SIGNAL( endInsertItems() ),
302-
this, SLOT( emitEndInsertItems() ) );
302+
this, SLOT( emitEndInsertItems() ) );
303303
disconnect( child, SIGNAL( beginRemoveItems( QgsDataItem*, int, int ) ),
304-
this, SLOT( emitBeginRemoveItems( QgsDataItem*, int, int ) ) );
304+
this, SLOT( emitBeginRemoveItems( QgsDataItem*, int, int ) ) );
305305
disconnect( child, SIGNAL( endRemoveItems() ),
306-
this, SLOT( emitEndRemoveItems() ) );
307-
child->setParent(0);
306+
this, SLOT( emitEndRemoveItems() ) );
307+
child->setParent( 0 );
308308
return child;
309309
}
310310

@@ -414,10 +414,10 @@ QgsDataCollectionItem::QgsDataCollectionItem( QgsDataItem* parent, QString name,
414414

415415
QgsDataCollectionItem::~QgsDataCollectionItem()
416416
{
417-
QgsDebugMsg( "Entered");
417+
QgsDebugMsg( "Entered" );
418418
foreach( QgsDataItem* i, mChildren )
419419
{
420-
QgsDebugMsg( QString("delete child = 0x%0").arg((qlonglong)i,8,16,QLatin1Char('0')) );
420+
QgsDebugMsg( QString( "delete child = 0x%0" ).arg(( qlonglong )i, 8, 16, QLatin1Char( '0' ) ) );
421421
delete i;
422422
}
423423
}

‎src/core/qgsmessageoutput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void QgsMessageOutputConsole::showMessage( bool )
6767
{
6868
mMessage.replace( "<br>", "\n" );
6969
mMessage.replace( "&nbsp;", " " );
70-
mMessage.replace( QRegExp("</?[^>]+>"), "" );
70+
mMessage.replace( QRegExp( "</?[^>]+>" ), "" );
7171
}
7272
QgsMessageLog::logMessage( mMessage, mTitle.isNull() ? QObject::tr( "Console" ) : mTitle );
7373
emit destroyed();

‎src/core/qgsowsconnection.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class QgsOWSConnection : public QObject
4747
/**
4848
* Constructor
4949
* @param theService service name: WMS,WFS,WCS
50+
* @param theConnName connection name
5051
*/
5152
QgsOWSConnection( const QString & theService, const QString & theConnName );
5253
//! Destructor

‎src/core/raster/qgsrasterrenderer.h

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,26 +89,42 @@ class CORE_EXPORT QgsRasterRenderer
8989
inline double readValue( void *data, QgsRasterDataProvider::DataType type, int index );
9090

9191
/**Start reading of raster band. Raster data can then be retrieved by calling readNextRasterPart until it returns false.
92-
@param bandNumer number of raster band to read
92+
@param bandNumber number of raster band to read
9393
@param viewPort describes raster position on screen
94+
@param mapToPixel transform map to pixel
9495
@param oversamplingX out: oversampling rate in x-direction
9596
@param oversamplingY out: oversampling rate in y-direction*/
9697
void startRasterRead( int bandNumber, QgsRasterViewPort* viewPort, const QgsMapToPixel* mapToPixel, double& oversamplingX, double& oversamplingY );
9798
/**Fetches next part of raster data
99+
@param bandNumber number of raster band to read
100+
@param oversamplingX oversampling rate in x-direction
101+
@param oversamplingY oversampling rate in y-direction
102+
@param viewPort view port
98103
@param nCols number of columns on output device
99104
@param nRows number of rows on output device
100105
@param nColsRaster number of raster columns (different to nCols if oversamplingX != 1.0)
101-
@param nRowsRaster number of raster rows (different to nRows if oversamplingY != 0)*/
106+
@param nRowsRaster number of raster rows (different to nRows if oversamplingY != 0)
107+
@param rasterData raster data
108+
@param topLeftCol Left position relative to left border of viewport
109+
@param topLeftRow Top position relative to top border of viewport*/
102110
bool readNextRasterPart( int bandNumber, double oversamplingX, double oversamplingY, QgsRasterViewPort* viewPort, int& nCols, int& nRows,
103111
int& nColsRaster, int& nRowsRaster, void** rasterData, int& topLeftCol, int& topLeftRow );
104112
/**Draws raster part
113+
@param p the painter
114+
@param viewPort view port
115+
@param img image
105116
@param topLeftCol Left position relative to left border of viewport
106-
@param topLeftRow Top position relative to top border of viewport*/
117+
@param topLeftRow Top position relative to top border of viewport
118+
@param nCols number of columns
119+
@param nRows number of rows
120+
@param oversamplingX oversampling rate in x-direction
121+
@param oversamplingY oversampling rate in y-direction
122+
*/
107123
void drawImage( QPainter* p, QgsRasterViewPort* viewPort, const QImage& img, int topLeftCol, int topLeftRow,
108124
int nCols, int nRows, double oversamplingX, double oversamplingY ) const;
109125
void stopRasterRead( int bandNumber );
110126

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

114130

‎src/core/raster/qgsrasterresampler.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class QImage;
2626
class QgsRasterResampler
2727
{
2828
public:
29+
virtual ~QgsRasterResampler() {}
2930
virtual void resample( const QImage& srcImage, QImage& dstImage ) = 0;
3031
virtual QString type() const = 0;
3132
};

‎src/core/symbology-ng/qgsrulebasedrendererv2.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,8 @@ void QgsRuleBasedRendererV2::refineRuleRanges( QgsRuleBasedRendererV2::Rule* ini
828828
// TODO: have a possibility to construct expressions directly as a parse tree to avoid loss of precision
829829
QString attr = QgsExpression::quotedColumnRef( r->classAttribute() );
830830
QString filter = QString( "%1 >= %2 AND %1 <= %3" ).arg( attr )
831-
.arg( QString::number( rng.lowerValue(), 'f', 4 ) )
832-
.arg( QString::number( rng.upperValue(), 'f', 4 ) );
831+
.arg( QString::number( rng.lowerValue(), 'f', 4 ) )
832+
.arg( QString::number( rng.upperValue(), 'f', 4 ) );
833833
QString label = filter;
834834
initialRule->appendChild( new Rule( rng.symbol()->clone(), 0, 0, filter, label ) );
835835
}

‎src/gui/attributetable/qgsattributetablemodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void QgsAttributeTableModel::attributeDeleted( int idx )
168168
{
169169
QgsFeatureId fid = rowToId( row );
170170

171-
if( !mFeatureMap.contains( fid ) )
171+
if ( !mFeatureMap.contains( fid ) )
172172
continue;
173173

174174
mFeatureMap[ fid ].deleteAttribute( idx );

‎src/gui/qgsowssourceselect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ void QgsOWSSourceSelect::addClicked()
379379
QgsDebugMsg( "entered" );
380380
}
381381

382-
void QgsOWSSourceSelect::enableLayersForCrs( QTreeWidgetItem *item )
382+
void QgsOWSSourceSelect::enableLayersForCrs( QTreeWidgetItem * )
383383
{
384384
}
385385

‎src/plugins/georeferencer/qgsgeorefplugingui.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,19 +1030,19 @@ void QgsGeorefPluginGui::setupConnections()
10301030

10311031
void QgsGeorefPluginGui::removeOldLayer()
10321032
{
1033-
// delete layer (and don't signal it as it's our private layer)
1034-
if ( mLayer )
1035-
{
1036-
QgsMapLayerRegistry::instance()->removeMapLayers(
1037-
( QStringList() << mLayer->id() ), false );
1038-
mLayer = NULL;
1039-
}
1040-
mCanvas->refresh();
1033+
// delete layer (and don't signal it as it's our private layer)
1034+
if ( mLayer )
1035+
{
1036+
QgsMapLayerRegistry::instance()->removeMapLayers(
1037+
( QStringList() << mLayer->id() ), false );
1038+
mLayer = NULL;
1039+
}
1040+
mCanvas->refresh();
10411041
}
10421042

10431043
void QgsGeorefPluginGui::updateIconTheme( QString theme )
10441044
{
1045-
Q_UNUSED(theme);
1045+
Q_UNUSED( theme );
10461046
// File actions
10471047
mActionOpenRaster->setIcon( getThemeIcon( "/mActionOpenRaster.png" ) );
10481048
mActionStartGeoref->setIcon( getThemeIcon( "/mActionStartGeoref.png" ) );

‎src/plugins/georeferencer/qgsgeorefplugingui.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class QgsGeorefPluginGui : public QMainWindow, private Ui::QgsGeorefPluginGuiBas
114114

115115
bool updateGeorefTransform();
116116

117-
void updateIconTheme( QString theme);
117+
void updateIconTheme( QString theme );
118118

119119
private:
120120
enum SaveGCPs

‎src/providers/gdal/qgswcscapabilities.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ void QgsWcsCapabilities::parseContentMetadata( QDomElement const & e, QgsWcsCove
501501

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

‎src/providers/gdal/qgswcssourceselect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ QStringList QgsWCSSourceSelect::selectedLayersCRSs()
233233
return c->supportedCrs;
234234
}
235235

236-
void QgsWCSSourceSelect::enableLayersForCrs( QTreeWidgetItem *item )
236+
void QgsWCSSourceSelect::enableLayersForCrs( QTreeWidgetItem * )
237237
{
238238
// TODO: I am not convinced to disable layers according to selected CRS
239239
}

‎src/providers/mssql/qgsmssqlprovider.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -605,9 +605,9 @@ void QgsMssqlProvider::select( QgsAttributeList fetchAttributes,
605605
if ( !mSqlWhereClause.isEmpty() )
606606
{
607607
if ( rect.isEmpty() )
608-
mStatement += " where (" + mSqlWhereClause + ")";
608+
mStatement += " where (" + mSqlWhereClause + ")";
609609
else
610-
mStatement += " and (" + mSqlWhereClause + ")";
610+
mStatement += " and (" + mSqlWhereClause + ")";
611611
}
612612

613613
mFetchGeom = fetchGeometry;
@@ -638,7 +638,7 @@ QVariant QgsMssqlProvider::minimumValue( int index )
638638
.arg( fld.name() );
639639

640640
if ( !mSchemaName.isEmpty() )
641-
sql += "[" + mSchemaName + "].";
641+
sql += "[" + mSchemaName + "].";
642642

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

@@ -676,7 +676,7 @@ QVariant QgsMssqlProvider::maximumValue( int index )
676676
.arg( fld.name() );
677677

678678
if ( !mSchemaName.isEmpty() )
679-
sql += "[" + mSchemaName + "].";
679+
sql += "[" + mSchemaName + "].";
680680

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

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

713713
// get the field name
714714
QgsField fld = mAttributeFields[ index ];
715-
QString sql = QString( "select distinct ");
716-
717-
if (limit > 0)
715+
QString sql = QString( "select distinct " );
716+
717+
if ( limit > 0 )
718718
{
719719
sql += QString( " top %1 " ).arg( limit );
720720
}
721721

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

725725
if ( !mSchemaName.isEmpty() )
726-
sql += "[" + mSchemaName + "].";
726+
sql += "[" + mSchemaName + "].";
727727

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

‎src/providers/ows/qgsowsdataitems.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ static QStringList wildcards = QStringList();
219219

220220
QGISEXTERN int dataCapabilities()
221221
{
222-
return QgsDataProvider::Net;
222+
return QgsDataProvider::Net;
223223
}
224224

225225
QGISEXTERN QgsDataItem * dataItem( QString thePath, QgsDataItem* parentItem )
@@ -228,12 +228,13 @@ QGISEXTERN QgsDataItem * dataItem( QString thePath, QgsDataItem* parentItem )
228228
{
229229
return new QgsOWSRootItem( parentItem, "OWS", "ows:" );
230230
}
231-
231+
return 0;
232232
}
233233

234234
//QGISEXTERN QgsOWSSourceSelect * selectWidget( QWidget * parent, Qt::WFlags fl )
235235
QGISEXTERN QDialog * selectWidget( QWidget * parent, Qt::WFlags fl )
236236
{
237+
Q_UNUSED( parent );
237238
//return new QgsOWSSourceSelect( parent, fl );
238239
return 0;
239240
}

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2872,7 +2872,7 @@ bool QgsPostgresProvider::getGeometryDetails()
28722872
mEnabledCapabilities &= ~( QgsVectorDataProvider::ChangeGeometries | QgsVectorDataProvider::AddFeatures );
28732873
}
28742874

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

28782878
return mValid;

‎src/providers/wfs/qgswfsdataitems.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ QVector<QgsDataItem*> QgsWFSConnectionItem::createChildren()
5555

5656
QString encodedUri = mPath;
5757
QgsDataSourceURI uri;
58-
uri.setEncodedUri ( encodedUri );
58+
uri.setEncodedUri( encodedUri );
5959
QgsDebugMsg( "encodedUri = " + encodedUri );
6060

6161
mCapabilities = new QgsWFSCapabilities( encodedUri );
@@ -155,7 +155,7 @@ QVector<QgsDataItem*> QgsWFSRootItem::createChildren()
155155
{
156156
QgsOWSConnection connection( "WF", connName );
157157
QgsDataItem * conn = new QgsWFSConnectionItem( this, connName, connection.uri().encodedUri() );
158-
conn->setIcon ( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
158+
conn->setIcon( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
159159
connections.append( conn );
160160
}
161161
return connections;

‎src/providers/wms/qgswmsconnection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ QgsWMSConnection::QgsWMSConnection( QString theConnName ) :
103103
mUri.setParam( "InvertAxisOrientation", "1" );
104104
}
105105

106-
if( !connArgs.isEmpty() )
106+
if ( !connArgs.isEmpty() )
107107
{
108108
connArgs.prepend( "ignoreUrl=" );
109109

‎src/providers/wms/qgswmsdataitems.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,23 @@ QVector<QgsDataItem*> QgsWMSConnectionItem::createChildren()
4242

4343
QString encodedUri = mPath;
4444
QgsDataSourceURI uri;
45-
uri.setEncodedUri ( encodedUri );
46-
/*
47-
if ( mPath.contains ( "url=" ) )
45+
uri.setEncodedUri( encodedUri );
46+
#if 0
47+
if ( mPath.contains( "url=" ) )
4848
{
4949
encodedUri = mPath;
50-
uri.setEncodedUri ( encodedUri );
50+
uri.setEncodedUri( encodedUri );
5151
}
5252
else
5353
{
5454
QgsWMSConnection connection( mName );
5555
uri = connection.uri();
5656
encodedUri = uri.encodedUri();
5757
}
58-
*/
58+
#endif
5959
QgsDebugMsg( "encodedUri = " + encodedUri );
6060

61-
QgsWmsProvider *wmsProvider = new QgsWmsProvider ( encodedUri );
61+
QgsWmsProvider *wmsProvider = new QgsWmsProvider( encodedUri );
6262
if ( !wmsProvider ) return children;
6363

6464
// Attention: supportedLayers() gives tree leafes, not top level
@@ -100,7 +100,7 @@ bool QgsWMSConnectionItem::equal( const QgsDataItem *other )
100100
{
101101
return false;
102102
}
103-
103+
104104
return ( mPath == o->mPath && mName == o->mName );
105105
}
106106

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

243-
conn->setIcon ( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
243+
conn->setIcon( QIcon( getThemePixmap( "mIconConnect.png" ) ) );
244244
connections.append( conn );
245245
}
246246
return connections;

0 commit comments

Comments
 (0)
Please sign in to comment.