Skip to content

Commit cec5bde

Browse files
committedMay 24, 2015
fix some warnings
1 parent 3ecf6e6 commit cec5bde

19 files changed

+427
-426
lines changed
 

‎python/core/qgshistogram.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class QgsHistogram
1212
%End
1313

1414
public:
15-
15+
1616
QgsHistogram();
1717

1818
virtual ~QgsHistogram();
@@ -61,6 +61,6 @@ class QgsHistogram
6161
* @note values must first be specified using @link setValues @endlink
6262
*/
6363
QList<int> counts( int bins ) const;
64-
64+
6565
};
6666

‎python/core/symbology-ng/qgssymbollayerv2.sip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,9 +317,9 @@ class QgsMarkerSymbolLayerV2 : QgsSymbolLayerV2
317317

318318
void setAngle( double angle );
319319
double angle() const;
320-
321-
/** Sets the line angle modification for the symbol's angle. This angle is added to
322-
* the marker's rotation and data defined rotation before rendering the symbol, and
320+
321+
/** Sets the line angle modification for the symbol's angle. This angle is added to
322+
* the marker's rotation and data defined rotation before rendering the symbol, and
323323
* is usually used for orienting symbols to match a line's angle.
324324
* @param lineangle Angle in degrees, valid values are between 0 and 360
325325
* @note added in QGIS 2.9

‎python/core/symbology-ng/qgssymbolv2.sip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ class QgsMarkerSymbolV2 : QgsSymbolV2
236236

237237
void setAngle( double angle );
238238
double angle();
239-
240-
/** Sets the line angle modification for the symbol's angle. This angle is added to
241-
* the marker's rotation and data defined rotation before rendering the symbol, and
239+
240+
/** Sets the line angle modification for the symbol's angle. This angle is added to
241+
* the marker's rotation and data defined rotation before rendering the symbol, and
242242
* is usually used for orienting symbols to match a line's angle.
243243
* @param lineangle Angle in degrees, valid values are between 0 and 360
244244
* @note added in QGIS 2.9

‎python/gui/qgshistogramwidget.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class QgsHistogramWidget : QWidget
2121
* @param fieldOrExp field name or expression string
2222
*/
2323
QgsHistogramWidget( QWidget *parent /TransferThis/ = 0, QgsVectorLayer* layer = 0, const QString& fieldOrExp = QString() );
24-
24+
2525
~QgsHistogramWidget();
2626

2727
/** Returns the layer currently associated with the widget.

‎src/core/qgsvectorlayer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ QGis::GeometryType QgsVectorLayer::geometryType() const
598598
return QGis::Polygon;
599599

600600
case QGis::WKBNoGeometry:
601+
case QGis::WKBUnknown:
601602
return QGis::NoGeometry;
602603
}
603604
QgsDebugMsg( QString( "Data Provider Geometry type is not recognised, is %1" ).arg( type ) );

‎src/core/symbology-ng/qgsrendererv2.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,15 @@ class CORE_EXPORT QgsFeatureRendererV2
272272

273273
QgsPaintEffect* mPaintEffect;
274274

275-
/**@note this function is used to convert old sizeScale expresssions to symbol
275+
/**@note this function is used to convert old sizeScale expresssions to symbol
276276
* level DataDefined size
277277
*/
278278
static void convertSymbolSizeScale( QgsSymbolV2 * symbol, QgsSymbolV2::ScaleMethod method, const QString & field );
279-
/**@note this function is used to convert old rotations expresssions to symbol
279+
/**@note this function is used to convert old rotations expresssions to symbol
280280
* level DataDefined angle
281281
*/
282282
static void convertSymbolRotation( QgsSymbolV2 * symbol, const QString & field );
283-
283+
284284
private:
285285
Q_DISABLE_COPY( QgsFeatureRendererV2 )
286286
};

‎src/gui/editorwidgets/qgsphotowidgetwrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ QgsPhotoWidgetWrapper::QgsPhotoWidgetWrapper( QgsVectorLayer* vl, int fieldIdx,
2828
, mButton( 0 )
2929
{
3030
#ifdef WITH_QTWEBKIT
31-
mWebView = 0;
31+
mWebView = 0;
3232
#endif
3333
}
3434

‎src/plugins/spatialquery/qgsspatialqueryplugin.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@
4040
#include <QMessageBox>
4141

4242

43-
#ifdef WIN32
44-
#define QGISEXTERN extern "C" __declspec( dllexport )
45-
#else
46-
#define QGISEXTERN extern "C"
47-
#endif
48-
4943
static const QString name_ = QObject::tr( "Spatial Query Plugin" );
5044
static const QString description_ = QObject::tr( "A plugin that makes spatial queries on vector layers" );
5145
static const QString category_ = QObject::tr( "Vector" );

‎src/providers/gdal/qgsgdalproviderbase.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ QGis::DataType QgsGdalProviderBase::dataTypeFromGdal( const GDALDataType theGdal
161161
case GDT_CInt32: return QGis::CInt32;
162162
case GDT_CFloat32: return QGis::CFloat32;
163163
case GDT_CFloat64: return QGis::CFloat64;
164-
case GDT_Unknown: return QGis::UnknownDataType;
164+
case GDT_Unknown:
165+
case GDT_TypeCount:
166+
return QGis::UnknownDataType;
165167
}
166168
return QGis::UnknownDataType;
167169
}

‎src/providers/grass/qgsgrassfeatureiterator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ bool QgsGrassFeatureIterator::fetchFeature( QgsFeature& feature )
258258

259259
feature.setFeatureId( featureId );
260260
feature.initAttributes( mSource->mFields.count() );
261-
feature.setFields( &mSource->mFields ); // allow name-based attribute lookups
261+
feature.setFields( mSource->mFields ); // allow name-based attribute lookups
262262

263263
if ( mRequest.flags() & QgsFeatureRequest::NoGeometry )
264264
feature.setGeometry( 0 );

‎src/providers/grass/qgsgrassprovidermodule.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -159,15 +159,7 @@ QVector<QgsDataItem*> QgsGrassMapsetItem::createChildren()
159159
QgsDebugMsg( "uri = " + uri );
160160

161161
QgsGrassObject rasterObject( mGisdbase, mLocation, mName, name, QgsGrassObject::Raster );
162-
bool isExternal = false;
163-
if ( QgsGrass::isExternal( rasterObject ) )
164-
{
165-
isExternal = true;
166-
//rasterObject.setName( rasterObject.name() + " external" );
167-
}
168162
QgsGrassRasterItem *layer = new QgsGrassRasterItem( this, rasterObject, path, uri, QgsGrass::isExternal( rasterObject ) );
169-
170-
171163
items.append( layer );
172164
}
173165

‎src/providers/postgres/qgspostgresexpressioncompiler.cpp

Lines changed: 76 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
#include "qgspostgresexpressioncompiler.h"
1717

1818
QgsPostgresExpressionCompiler::QgsPostgresExpressionCompiler( QgsPostgresFeatureSource* source )
19-
: mResult( None )
20-
, mSource( source )
19+
: mResult( None )
20+
, mSource( source )
2121
{
2222
}
2323

@@ -29,19 +29,19 @@ QgsPostgresExpressionCompiler::~QgsPostgresExpressionCompiler()
2929
QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( const QgsExpression* exp )
3030
{
3131
if ( exp->rootNode() )
32-
return compile ( exp->rootNode(), mResult );
32+
return compile( exp->rootNode(), mResult );
3333
else
3434
return Fail;
3535
}
3636

3737
QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( const QgsExpression::Node* node, QString& result )
3838
{
39-
switch( node->nodeType() )
39+
switch ( node->nodeType() )
4040
{
4141
case QgsExpression::ntUnaryOperator:
4242
{
4343
const QgsExpression::NodeUnaryOperator* n = static_cast<const QgsExpression::NodeUnaryOperator*>( node );
44-
switch( n->op() )
44+
switch ( n->op() )
4545
{
4646
case QgsExpression::uoNot:
4747
break;
@@ -55,14 +55,9 @@ QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( co
5555

5656
case QgsExpression::ntBinaryOperator:
5757
{
58-
QString op;
59-
QString left;
60-
QString right;
61-
Result lr;
62-
Result rr;
63-
6458
const QgsExpression::NodeBinaryOperator* n = static_cast<const QgsExpression::NodeBinaryOperator*>( node );
6559

60+
QString op;
6661
switch ( n->op() )
6762
{
6863
case QgsExpression::boEQ:
@@ -85,6 +80,14 @@ QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( co
8580
op = "<";
8681
break;
8782

83+
case QgsExpression::boIs:
84+
op = "IS";
85+
break;
86+
87+
case QgsExpression::boIsNot:
88+
op = "IS NOT";
89+
break;
90+
8891
case QgsExpression::boLike:
8992
op = "LIKE";
9093
break;
@@ -93,6 +96,14 @@ QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( co
9396
op = "ILIKE";
9497
break;
9598

99+
case QgsExpression::boNotLike:
100+
op = "NOT LIKE";
101+
break;
102+
103+
case QgsExpression::boNotILike:
104+
op = "NOT ILIKE";
105+
break;
106+
96107
case QgsExpression::boOr:
97108
op = "OR";
98109
break;
@@ -104,26 +115,54 @@ QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( co
104115
case QgsExpression::boNE:
105116
op = "<>";
106117
break;
107-
}
108118

109-
if ( !op.isNull() )
110-
{
111-
lr = compile( n->opLeft(), left );
112-
rr = compile( n->opRight(), right );
113-
result = left + " " + op + " " + right;
114-
return ( lr == Complete && rr == Complete ) ? Complete : Fail;
119+
case QgsExpression::boMul:
120+
op = "*";
121+
break;
122+
123+
case QgsExpression::boPlus:
124+
op = "+";
125+
break;
126+
127+
case QgsExpression::boMinus:
128+
op = "-";
129+
break;
130+
131+
case QgsExpression::boDiv:
132+
return Fail; // handle cast to real
133+
134+
case QgsExpression::boMod:
135+
op = "%";
136+
break;
137+
138+
case QgsExpression::boConcat:
139+
op = "||";
140+
break;
141+
142+
case QgsExpression::boIntDiv:
143+
return Fail; // handle cast to int
144+
145+
case QgsExpression::boPow:
146+
op = "^";
147+
break;
148+
149+
case QgsExpression::boRegexp:
150+
op = "~";
151+
break;
115152
}
116-
else
117-
{
153+
154+
if ( op.isNull() )
118155
return Fail;
119-
}
120156

121-
break;
122-
}
157+
QString left;
158+
Result lr( compile( n->opLeft(), left ) );
123159

124-
case QgsExpression::ntFunction:
125-
return Fail;
126-
break;
160+
QString right;
161+
Result rr( compile( n->opRight(), right ) );
162+
163+
result = left + " " + op + " " + right;
164+
return ( lr == Complete && rr == Complete ) ? Complete : Fail;
165+
}
127166

128167
case QgsExpression::ntLiteral:
129168
{
@@ -136,17 +175,20 @@ QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( co
136175
{
137176
const QgsExpression::NodeColumnRef* n = static_cast<const QgsExpression::NodeColumnRef*>( node );
138177

139-
if ( mSource->mFields.indexFromName( n->name() ) != -1 )
140-
{
141-
result = QgsPostgresConn::quotedIdentifier( n->name() );
142-
return Complete;
143-
}
144-
else
145-
{
178+
if ( mSource->mFields.indexFromName( n->name() ) == -1 )
146179
// Not a provider field
147180
return Fail;
148-
}
181+
182+
result = QgsPostgresConn::quotedIdentifier( n->name() );
183+
184+
return Complete;
149185
}
186+
187+
case QgsExpression::ntFunction:
188+
case QgsExpression::ntCondition:
189+
case QgsExpression::ntInOperator:
190+
break;
150191
}
192+
151193
return Fail;
152194
}

‎src/providers/postgres/qgspostgresexpressioncompiler.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
class QgsPostgresExpressionCompiler
2323
{
2424
public:
25-
enum Result {
25+
enum Result
26+
{
2627
None,
2728
Complete,
2829
Partial,

‎src/providers/postgres/qgspostgresfeatureiterator.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresFeatureSource
3434
, mFeatureQueueSize( sFeatureQueueSize )
3535
, mFetched( 0 )
3636
, mFetchGeometry( false )
37-
, mExpressionCompiled( false)
37+
, mExpressionCompiled( false )
3838
{
3939
if ( !source->mTransactionConnection )
4040
{
@@ -165,8 +165,7 @@ bool QgsPostgresFeatureIterator::fetchFeature( QgsFeature& feature )
165165
}
166166
else
167167
{
168-
QgsGeometry* featureGeom = mFeatureQueue.front().geometryAndOwnership();
169-
feature.setGeometry( featureGeom );
168+
feature.setGeometry( mFeatureQueue.front().geometryAndOwnership() );
170169
}
171170
feature.setFeatureId( mFeatureQueue.front().id() );
172171
feature.setAttributes( mFeatureQueue.front().attributes() );

‎src/providers/postgres/qgspostgresfeatureiterator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class QgsPostgresFeatureIterator : public QgsAbstractFeatureIteratorFromSource<Q
8686
virtual bool fetchFeature( QgsFeature& feature ) override;
8787

8888
//! fetch next feature filter expression
89-
bool nextFeatureFilterExpression(QgsFeature& f);
89+
bool nextFeatureFilterExpression( QgsFeature& f );
9090

9191
//! Setup the simplification of geometries to fetch using the specified simplify method
9292
virtual bool prepareSimplification( const QgsSimplifyMethod& simplifyMethod ) override;

‎src/providers/spatialite/qgsspatialiteprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ QgsSpatiaLiteProvider::QgsSpatiaLiteProvider( QString const &uri )
497497
closeDb();
498498
return;
499499
}
500-
enabledCapabilities = mPrimaryKey.isEmpty() ? 0 : (QgsVectorDataProvider::SelectAtId | QgsVectorDataProvider::SelectGeometryAtId);
500+
enabledCapabilities = mPrimaryKey.isEmpty() ? 0 : ( QgsVectorDataProvider::SelectAtId | QgsVectorDataProvider::SelectGeometryAtId );
501501
if (( mTableBased || mViewBased ) && !mReadOnly )
502502
{
503503
// enabling editing only for Tables [excluding Views and VirtualShapes]

‎src/server/qgssldconfigparser.cpp

Lines changed: 324 additions & 354 deletions
Large diffs are not rendered by default.

‎src/server/qgswmsserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2150,7 +2150,7 @@ int QgsWMSServer::featureInfoFromRasterLayer( QgsRasterLayer* layer,
21502150
fields.append( QgsField( layer->bandName( it.key() ), QVariant::Double ) );
21512151
feature.setAttribute( index++, QString::number( it.value().toDouble() ) );
21522152
}
2153-
feature.setFields( &fields );
2153+
feature.setFields( fields );
21542154

21552155
QgsCoordinateReferenceSystem layerCrs = layer->crs();
21562156
int version = infoFormat.startsWith( "application/vnd.ogc.gml/3" ) ? 3 : 2;

‎tests/src/core/testqgshistogram.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ void TestQgsHistogram::fromLayer()
130130
{
131131
QgsHistogram h;
132132

133-
QVERIFY( !h.setValues( 0, QString() ));
133+
QVERIFY( !h.setValues( 0, QString() ) );
134134

135135
QgsVectorLayer* layer = new QgsVectorLayer( "Point?field=col1:real", "layer", "memory" );
136136
QVERIFY( layer->isValid() );
@@ -143,7 +143,7 @@ void TestQgsHistogram::fromLayer()
143143
}
144144
layer->dataProvider()->addFeatures( features );
145145

146-
QVERIFY( !h.setValues( layer, QString() ));
146+
QVERIFY( !h.setValues( layer, QString() ) );
147147
QVERIFY( h.setValues( layer, QString( "col1" ) ) );
148148
QList<int>counts = h.counts( 5 );
149149
QList<int> expected;

0 commit comments

Comments
 (0)
Please sign in to comment.