Skip to content

Commit

Permalink
fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed May 24, 2015
1 parent 3ecf6e6 commit cec5bde
Show file tree
Hide file tree
Showing 19 changed files with 427 additions and 426 deletions.
4 changes: 2 additions & 2 deletions python/core/qgshistogram.sip
Expand Up @@ -12,7 +12,7 @@ class QgsHistogram
%End

public:

QgsHistogram();

virtual ~QgsHistogram();
Expand Down Expand Up @@ -61,6 +61,6 @@ class QgsHistogram
* @note values must first be specified using @link setValues @endlink
*/
QList<int> counts( int bins ) const;

};

6 changes: 3 additions & 3 deletions python/core/symbology-ng/qgssymbollayerv2.sip
Expand Up @@ -317,9 +317,9 @@ class QgsMarkerSymbolLayerV2 : QgsSymbolLayerV2

void setAngle( double angle );
double angle() const;
/** Sets the line angle modification for the symbol's angle. This angle is added to
* the marker's rotation and data defined rotation before rendering the symbol, and

/** Sets the line angle modification for the symbol's angle. This angle is added to
* the marker's rotation and data defined rotation before rendering the symbol, and
* is usually used for orienting symbols to match a line's angle.
* @param lineangle Angle in degrees, valid values are between 0 and 360
* @note added in QGIS 2.9
Expand Down
6 changes: 3 additions & 3 deletions python/core/symbology-ng/qgssymbolv2.sip
Expand Up @@ -236,9 +236,9 @@ class QgsMarkerSymbolV2 : QgsSymbolV2

void setAngle( double angle );
double angle();
/** Sets the line angle modification for the symbol's angle. This angle is added to
* the marker's rotation and data defined rotation before rendering the symbol, and

/** Sets the line angle modification for the symbol's angle. This angle is added to
* the marker's rotation and data defined rotation before rendering the symbol, and
* is usually used for orienting symbols to match a line's angle.
* @param lineangle Angle in degrees, valid values are between 0 and 360
* @note added in QGIS 2.9
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgshistogramwidget.sip
Expand Up @@ -21,7 +21,7 @@ class QgsHistogramWidget : QWidget
* @param fieldOrExp field name or expression string
*/
QgsHistogramWidget( QWidget *parent /TransferThis/ = 0, QgsVectorLayer* layer = 0, const QString& fieldOrExp = QString() );

~QgsHistogramWidget();

/** Returns the layer currently associated with the widget.
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -598,6 +598,7 @@ QGis::GeometryType QgsVectorLayer::geometryType() const
return QGis::Polygon;

case QGis::WKBNoGeometry:
case QGis::WKBUnknown:
return QGis::NoGeometry;
}
QgsDebugMsg( QString( "Data Provider Geometry type is not recognised, is %1" ).arg( type ) );
Expand Down
6 changes: 3 additions & 3 deletions src/core/symbology-ng/qgsrendererv2.h
Expand Up @@ -272,15 +272,15 @@ class CORE_EXPORT QgsFeatureRendererV2

QgsPaintEffect* mPaintEffect;

/**@note this function is used to convert old sizeScale expresssions to symbol
/**@note this function is used to convert old sizeScale expresssions to symbol
* level DataDefined size
*/
static void convertSymbolSizeScale( QgsSymbolV2 * symbol, QgsSymbolV2::ScaleMethod method, const QString & field );
/**@note this function is used to convert old rotations expresssions to symbol
/**@note this function is used to convert old rotations expresssions to symbol
* level DataDefined angle
*/
static void convertSymbolRotation( QgsSymbolV2 * symbol, const QString & field );

private:
Q_DISABLE_COPY( QgsFeatureRendererV2 )
};
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgsphotowidgetwrapper.cpp
Expand Up @@ -28,7 +28,7 @@ QgsPhotoWidgetWrapper::QgsPhotoWidgetWrapper( QgsVectorLayer* vl, int fieldIdx,
, mButton( 0 )
{
#ifdef WITH_QTWEBKIT
mWebView = 0;
mWebView = 0;
#endif
}

Expand Down
6 changes: 0 additions & 6 deletions src/plugins/spatialquery/qgsspatialqueryplugin.cpp
Expand Up @@ -40,12 +40,6 @@
#include <QMessageBox>


#ifdef WIN32
#define QGISEXTERN extern "C" __declspec( dllexport )
#else
#define QGISEXTERN extern "C"
#endif

static const QString name_ = QObject::tr( "Spatial Query Plugin" );
static const QString description_ = QObject::tr( "A plugin that makes spatial queries on vector layers" );
static const QString category_ = QObject::tr( "Vector" );
Expand Down
4 changes: 3 additions & 1 deletion src/providers/gdal/qgsgdalproviderbase.cpp
Expand Up @@ -161,7 +161,9 @@ QGis::DataType QgsGdalProviderBase::dataTypeFromGdal( const GDALDataType theGdal
case GDT_CInt32: return QGis::CInt32;
case GDT_CFloat32: return QGis::CFloat32;
case GDT_CFloat64: return QGis::CFloat64;
case GDT_Unknown: return QGis::UnknownDataType;
case GDT_Unknown:
case GDT_TypeCount:
return QGis::UnknownDataType;
}
return QGis::UnknownDataType;
}
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrassfeatureiterator.cpp
Expand Up @@ -258,7 +258,7 @@ bool QgsGrassFeatureIterator::fetchFeature( QgsFeature& feature )

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

if ( mRequest.flags() & QgsFeatureRequest::NoGeometry )
feature.setGeometry( 0 );
Expand Down
8 changes: 0 additions & 8 deletions src/providers/grass/qgsgrassprovidermodule.cpp
Expand Up @@ -159,15 +159,7 @@ QVector<QgsDataItem*> QgsGrassMapsetItem::createChildren()
QgsDebugMsg( "uri = " + uri );

QgsGrassObject rasterObject( mGisdbase, mLocation, mName, name, QgsGrassObject::Raster );
bool isExternal = false;
if ( QgsGrass::isExternal( rasterObject ) )
{
isExternal = true;
//rasterObject.setName( rasterObject.name() + " external" );
}
QgsGrassRasterItem *layer = new QgsGrassRasterItem( this, rasterObject, path, uri, QgsGrass::isExternal( rasterObject ) );


items.append( layer );
}

Expand Down
110 changes: 76 additions & 34 deletions src/providers/postgres/qgspostgresexpressioncompiler.cpp
Expand Up @@ -16,8 +16,8 @@
#include "qgspostgresexpressioncompiler.h"

QgsPostgresExpressionCompiler::QgsPostgresExpressionCompiler( QgsPostgresFeatureSource* source )
: mResult( None )
, mSource( source )
: mResult( None )
, mSource( source )
{
}

Expand All @@ -29,19 +29,19 @@ QgsPostgresExpressionCompiler::~QgsPostgresExpressionCompiler()
QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( const QgsExpression* exp )
{
if ( exp->rootNode() )
return compile ( exp->rootNode(), mResult );
return compile( exp->rootNode(), mResult );
else
return Fail;
}

QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( const QgsExpression::Node* node, QString& result )
{
switch( node->nodeType() )
switch ( node->nodeType() )
{
case QgsExpression::ntUnaryOperator:
{
const QgsExpression::NodeUnaryOperator* n = static_cast<const QgsExpression::NodeUnaryOperator*>( node );
switch( n->op() )
switch ( n->op() )
{
case QgsExpression::uoNot:
break;
Expand All @@ -55,14 +55,9 @@ QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( co

case QgsExpression::ntBinaryOperator:
{
QString op;
QString left;
QString right;
Result lr;
Result rr;

const QgsExpression::NodeBinaryOperator* n = static_cast<const QgsExpression::NodeBinaryOperator*>( node );

QString op;
switch ( n->op() )
{
case QgsExpression::boEQ:
Expand All @@ -85,6 +80,14 @@ QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( co
op = "<";
break;

case QgsExpression::boIs:
op = "IS";
break;

case QgsExpression::boIsNot:
op = "IS NOT";
break;

case QgsExpression::boLike:
op = "LIKE";
break;
Expand All @@ -93,6 +96,14 @@ QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( co
op = "ILIKE";
break;

case QgsExpression::boNotLike:
op = "NOT LIKE";
break;

case QgsExpression::boNotILike:
op = "NOT ILIKE";
break;

case QgsExpression::boOr:
op = "OR";
break;
Expand All @@ -104,26 +115,54 @@ QgsPostgresExpressionCompiler::Result QgsPostgresExpressionCompiler::compile( co
case QgsExpression::boNE:
op = "<>";
break;
}

if ( !op.isNull() )
{
lr = compile( n->opLeft(), left );
rr = compile( n->opRight(), right );
result = left + " " + op + " " + right;
return ( lr == Complete && rr == Complete ) ? Complete : Fail;
case QgsExpression::boMul:
op = "*";
break;

case QgsExpression::boPlus:
op = "+";
break;

case QgsExpression::boMinus:
op = "-";
break;

case QgsExpression::boDiv:
return Fail; // handle cast to real

case QgsExpression::boMod:
op = "%";
break;

case QgsExpression::boConcat:
op = "||";
break;

case QgsExpression::boIntDiv:
return Fail; // handle cast to int

case QgsExpression::boPow:
op = "^";
break;

case QgsExpression::boRegexp:
op = "~";
break;
}
else
{

if ( op.isNull() )
return Fail;
}

break;
}
QString left;
Result lr( compile( n->opLeft(), left ) );

case QgsExpression::ntFunction:
return Fail;
break;
QString right;
Result rr( compile( n->opRight(), right ) );

result = left + " " + op + " " + right;
return ( lr == Complete && rr == Complete ) ? Complete : Fail;
}

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

if ( mSource->mFields.indexFromName( n->name() ) != -1 )
{
result = QgsPostgresConn::quotedIdentifier( n->name() );
return Complete;
}
else
{
if ( mSource->mFields.indexFromName( n->name() ) == -1 )
// Not a provider field
return Fail;
}

result = QgsPostgresConn::quotedIdentifier( n->name() );

return Complete;
}

case QgsExpression::ntFunction:
case QgsExpression::ntCondition:
case QgsExpression::ntInOperator:
break;
}

return Fail;
}
3 changes: 2 additions & 1 deletion src/providers/postgres/qgspostgresexpressioncompiler.h
Expand Up @@ -22,7 +22,8 @@
class QgsPostgresExpressionCompiler
{
public:
enum Result {
enum Result
{
None,
Complete,
Partial,
Expand Down
5 changes: 2 additions & 3 deletions src/providers/postgres/qgspostgresfeatureiterator.cpp
Expand Up @@ -34,7 +34,7 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresFeatureSource
, mFeatureQueueSize( sFeatureQueueSize )
, mFetched( 0 )
, mFetchGeometry( false )
, mExpressionCompiled( false)
, mExpressionCompiled( false )
{
if ( !source->mTransactionConnection )
{
Expand Down Expand Up @@ -165,8 +165,7 @@ bool QgsPostgresFeatureIterator::fetchFeature( QgsFeature& feature )
}
else
{
QgsGeometry* featureGeom = mFeatureQueue.front().geometryAndOwnership();
feature.setGeometry( featureGeom );
feature.setGeometry( mFeatureQueue.front().geometryAndOwnership() );
}
feature.setFeatureId( mFeatureQueue.front().id() );
feature.setAttributes( mFeatureQueue.front().attributes() );
Expand Down
2 changes: 1 addition & 1 deletion src/providers/postgres/qgspostgresfeatureiterator.h
Expand Up @@ -86,7 +86,7 @@ class QgsPostgresFeatureIterator : public QgsAbstractFeatureIteratorFromSource<Q
virtual bool fetchFeature( QgsFeature& feature ) override;

//! fetch next feature filter expression
bool nextFeatureFilterExpression(QgsFeature& f);
bool nextFeatureFilterExpression( QgsFeature& f );

//! Setup the simplification of geometries to fetch using the specified simplify method
virtual bool prepareSimplification( const QgsSimplifyMethod& simplifyMethod ) override;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/spatialite/qgsspatialiteprovider.cpp
Expand Up @@ -497,7 +497,7 @@ QgsSpatiaLiteProvider::QgsSpatiaLiteProvider( QString const &uri )
closeDb();
return;
}
enabledCapabilities = mPrimaryKey.isEmpty() ? 0 : (QgsVectorDataProvider::SelectAtId | QgsVectorDataProvider::SelectGeometryAtId);
enabledCapabilities = mPrimaryKey.isEmpty() ? 0 : ( QgsVectorDataProvider::SelectAtId | QgsVectorDataProvider::SelectGeometryAtId );
if (( mTableBased || mViewBased ) && !mReadOnly )
{
// enabling editing only for Tables [excluding Views and VirtualShapes]
Expand Down

0 comments on commit cec5bde

Please sign in to comment.