Skip to content
Permalink
Browse files

fix some warnings

  • Loading branch information
jef-n committed May 24, 2015
1 parent 3ecf6e6 commit cec5bdeb0dc8e0ffd35737fee5b74d23647e85da
@@ -12,7 +12,7 @@ class QgsHistogram
%End

public:

QgsHistogram();

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

};

@@ -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
@@ -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
@@ -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.
@@ -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 ) );
@@ -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 )
};
@@ -28,7 +28,7 @@ QgsPhotoWidgetWrapper::QgsPhotoWidgetWrapper( QgsVectorLayer* vl, int fieldIdx,
, mButton( 0 )
{
#ifdef WITH_QTWEBKIT
mWebView = 0;
mWebView = 0;
#endif
}

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

@@ -16,8 +16,8 @@
#include "qgspostgresexpressioncompiler.h"

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

@@ -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;
@@ -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:
@@ -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;
@@ -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;
@@ -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:
{
@@ -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;
}
@@ -22,7 +22,8 @@
class QgsPostgresExpressionCompiler
{
public:
enum Result {
enum Result
{
None,
Complete,
Partial,
@@ -34,7 +34,7 @@ QgsPostgresFeatureIterator::QgsPostgresFeatureIterator( QgsPostgresFeatureSource
, mFeatureQueueSize( sFeatureQueueSize )
, mFetched( 0 )
, mFetchGeometry( false )
, mExpressionCompiled( false)
, mExpressionCompiled( false )
{
if ( !source->mTransactionConnection )
{
@@ -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() );
@@ -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;
@@ -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]

0 comments on commit cec5bde

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