Skip to content
Permalink
Browse files

fix windows build (pow called with an integer) and comma cosmetics

  • Loading branch information
jef-n committed Feb 8, 2015
1 parent 2e9cc1a commit a264a27dfb544072f5feea441b9c811e9d6f8bd7
@@ -2748,7 +2748,7 @@ void QgisApp::addLayerDefinition()
openLayerDefinition( path );
}

QString QgisApp::crsAndFormatAdjustedLayerUri( const QString &uri , const QStringList &supportedCrs, const QStringList &supportedFormats ) const
QString QgisApp::crsAndFormatAdjustedLayerUri( const QString &uri, const QStringList &supportedCrs, const QStringList &supportedFormats ) const
{
QString newuri = uri;

@@ -20,7 +20,7 @@
#include "qgsmapcanvas.h"


QgsAdvancedDigitizingCanvasItem::QgsAdvancedDigitizingCanvasItem( QgsMapCanvas* canvas , QgsAdvancedDigitizingDockWidget* cadDockWidget )
QgsAdvancedDigitizingCanvasItem::QgsAdvancedDigitizingCanvasItem( QgsMapCanvas* canvas, QgsAdvancedDigitizingDockWidget* cadDockWidget )
: QgsMapCanvasItem( canvas )
, mLockedPen( QPen( QColor( 100, 100, 255, 255 ), .7, Qt::DashLine ) )
, mConstruction1Pen( QPen( QColor( 100, 255, 100, 150 ), .7, Qt::DashLine ) )
@@ -46,7 +46,7 @@ bool QgsAdvancedDigitizingDockWidget::lineCircleIntersection( const QgsPoint& ce
const double dr = sqrt( pow( dx, 2 ) + pow( dy, 2 ) );
const double d = x1 * y2 - x2 * y1;

const double disc = pow( radius , 2 ) * pow( dr, 2 ) - pow( d, 2 );
const double disc = pow( radius, 2 ) * pow( dr, 2 ) - pow( d, 2 );

if ( disc < 0 )
{
@@ -21,7 +21,7 @@
#include "qgisapp.h"
#include "qgssnappingutils.h"

QgsMapMouseEvent::QgsMapMouseEvent( QgsMapToolAdvancedDigitizing* mapTool, QMouseEvent* event , SnappingMode mode )
QgsMapMouseEvent::QgsMapMouseEvent( QgsMapToolAdvancedDigitizing* mapTool, QMouseEvent* event, SnappingMode mode )
: QMouseEvent( event->type(), event->pos(), event->globalPos(), event->button(), event->buttons(), event->modifiers() )
, mMapPoint( mapTool->canvas()->mapSettings().mapToPixel().toMapCoordinates( event->pos() ) )
, mMapTool( mapTool )
@@ -172,7 +172,7 @@ QgsDataItem::QgsDataItem( QgsDataItem::Type type, QgsDataItem* parent, QString n

QgsDataItem::~QgsDataItem()
{
QgsDebugMsgLevel( QString( "mName = %1 mPath = %2 mChildren.size() = %3" ).arg( mName ).arg( mPath ).arg( mChildren.size() ) , 2 );
QgsDebugMsgLevel( QString( "mName = %1 mPath = %2 mChildren.size() = %3" ).arg( mName ).arg( mPath ).arg( mChildren.size() ), 2 );
foreach ( QgsDataItem *child, mChildren )
{
if ( !child ) // should not happen
@@ -79,7 +79,7 @@ void QgsDoubleSpinBox::clear()
setValue( clearValue() );
}

void QgsDoubleSpinBox::setClearValue( double customValue , QString specialValueText )
void QgsDoubleSpinBox::setClearValue( double customValue, QString specialValueText )
{
mClearValueMode = CustomValue;
mCustomClearValue = customValue;
@@ -769,7 +769,7 @@ void QgsColorBox::paintEvent( QPaintEvent *event )
painter.setPen( Qt::NoPen );

painter.drawRect( xPos - 1, mMargin, 3, height() - 2 * mMargin - 1 );
painter.drawRect( mMargin, yPos - 1 , width() - 2 * mMargin - 1, 3 );
painter.drawRect( mMargin, yPos - 1, width() - 2 * mMargin - 1, 3 );
painter.setPen( Qt::black );
painter.drawLine( xPos, mMargin, xPos, height() - mMargin - 1 );
painter.drawLine( mMargin, yPos, width() - mMargin - 1, yPos );
@@ -26,7 +26,7 @@ QgsMapLayerAction::QgsMapLayerAction( QString name, QObject* parent, Targets tar
}

/**Creates a map layer action which can run only on a specific layer*/
QgsMapLayerAction::QgsMapLayerAction( QString name, QObject* parent, QgsMapLayer* layer , Targets targets, QIcon icon )
QgsMapLayerAction::QgsMapLayerAction( QString name, QObject* parent, QgsMapLayer* layer, Targets targets, QIcon icon )
: QAction( icon, name, parent )
, mSingleLayer( true )
, mActionLayer( layer )
@@ -133,7 +133,7 @@ QMap<QString, QgsPostgresConn *> QgsPostgresConn::sConnectionsRO;
QMap<QString, QgsPostgresConn *> QgsPostgresConn::sConnectionsRW;
const int QgsPostgresConn::sGeomTypeSelectLimit = 100;

QgsPostgresConn *QgsPostgresConn::connectDb( QString conninfo, bool readonly, bool shared , bool transaction )
QgsPostgresConn *QgsPostgresConn::connectDb( QString conninfo, bool readonly, bool shared, bool transaction )
{
QMap<QString, QgsPostgresConn *> &connections =
readonly ? QgsPostgresConn::sConnectionsRO : QgsPostgresConn::sConnectionsRW;
@@ -164,7 +164,7 @@ QgsPostgresConn *QgsPostgresConn::connectDb( QString conninfo, bool readonly, bo
return conn;
}

QgsPostgresConn::QgsPostgresConn( QString conninfo, bool readOnly, bool shared , bool transaction )
QgsPostgresConn::QgsPostgresConn( QString conninfo, bool readOnly, bool shared, bool transaction )
: mRef( 1 )
, mOpenCursors( 0 )
, mConnInfo( conninfo )
@@ -26,7 +26,7 @@ QgsPostgresTransaction::QgsPostgresTransaction( const QString &connString )

}

bool QgsPostgresTransaction::beginTransaction( QString &error , int statementTimeout )
bool QgsPostgresTransaction::beginTransaction( QString &error, int statementTimeout )
{
mConn = QgsPostgresConn::connectDb( mConnString, false /*readonly*/, false /*shared*/, true /*transaction*/ );

@@ -24,7 +24,7 @@
#include <QFileInfo>
#include <QSettings>

QgsWCSConnectionItem::QgsWCSConnectionItem( QgsDataItem* parent, QString name, QString path , QString uri )
QgsWCSConnectionItem::QgsWCSConnectionItem( QgsDataItem* parent, QString name, QString path, QString uri )
: QgsDataCollectionItem( parent, name, path )
, mUri( uri )
{
@@ -38,7 +38,7 @@ QgsWFSLayerItem::~QgsWFSLayerItem()

////

QgsWFSConnectionItem::QgsWFSConnectionItem( QgsDataItem* parent, QString name, QString path , QString uri )
QgsWFSConnectionItem::QgsWFSConnectionItem( QgsDataItem* parent, QString name, QString path, QString uri )
: QgsDataCollectionItem( parent, name, path )
, mUri( uri )
, mCapabilities( NULL )
@@ -429,7 +429,7 @@ int main( int argc, char * argv[] )
}
else
{
QgsWMSServer wmsServer( configFilePath, parameterMap, p, theRequestHandler.data() , theMapRenderer.data(), &capabilitiesCache );
QgsWMSServer wmsServer( configFilePath, parameterMap, p, theRequestHandler.data(), theMapRenderer.data(), &capabilitiesCache );
wmsServer.executeRequest();
}
}
@@ -55,11 +55,11 @@ void TestQgsClipper::basic()
QgsClipper::trimPolygon( polygon, clipRect );

// Check nothing sticks out.
QVERIFY( checkBoundingBox( polygon , clipRect ) );
QVERIFY( checkBoundingBox( polygon, clipRect ) );
// Check that it didn't clip too much
QgsRectangle clipRectInner( clipRect );
clipRectInner.scale( 0.999 );
QVERIFY( ! checkBoundingBox( polygon , clipRectInner ) );
QVERIFY( ! checkBoundingBox( polygon, clipRectInner ) );

// A more complex example
polygon.clear();
@@ -71,11 +71,11 @@ void TestQgsClipper::basic()
// We should have 5 vertices now?
QCOMPARE( polygon.size(), 5 );
// Check nothing sticks out.
QVERIFY( checkBoundingBox( polygon , clipRect ) );
QVERIFY( checkBoundingBox( polygon, clipRect ) );
// Check that it didn't clip too much
clipRectInner = clipRect;
clipRectInner.scale( 0.999 );
QVERIFY( ! checkBoundingBox( polygon , clipRectInner ) );
QVERIFY( ! checkBoundingBox( polygon, clipRectInner ) );
};

bool TestQgsClipper::checkBoundingBox( QPolygonF polygon, QgsRectangle clipRect )
@@ -1071,7 +1071,7 @@ class TestQgsExpression: public QObject
QgsExpression e( string );
QVERIFY( !e.hasParserError() );
qDebug() << e.expression();
QCOMPARE( e.expression() , QgsExpression( e.expression() ).expression() );
QCOMPARE( e.expression(), QgsExpression( e.expression() ).expression() );
}

void quote_string()
@@ -505,7 +505,7 @@ void TestQgsGeometry::bufferCheck()
dumpPolygon( myPolygon );
QVERIFY( renderCheck( "geometry_bufferCheck", "Checking buffer(10,10) of B", 10 ) );
}
bool TestQgsGeometry::renderCheck( QString theTestName, QString theComment , int mismatchCount )
bool TestQgsGeometry::renderCheck( QString theTestName, QString theComment, int mismatchCount )
{
mReport += "<h2>" + theTestName + "</h2>\n";
mReport += "<h3>" + theComment + "</h3>\n";
@@ -85,7 +85,7 @@ class TestQgsImageOperation : public QObject
QString mReport;
QString mSampleImage;

bool imageCheck( QString testName , QImage &image, int mismatchCount );
bool imageCheck( QString testName, QImage &image, int mismatchCount );
};

void TestQgsImageOperation::initTestCase()
@@ -38,7 +38,7 @@ QString TestQgsMapSettings::toString( const QPolygonF& p, int dec ) const
{
QString s;
const char *sep = "";
double r = pow( 10, dec );
double r = pow( 10.0, dec );
for ( int i = 0; i < p.size(); ++i )
{
s += QString( "%1%2 %3" ).arg( sep )
@@ -244,13 +244,13 @@ class TestQgsPointLocator : public QObject
void testExtent()
{
QgsRectangle bbox1( 10, 10, 11, 11 ); // out of layer's bounds
QgsPointLocator loc1( mVL, 0 , &bbox1 );
QgsPointLocator loc1( mVL, 0, &bbox1 );

QgsPointLocator::Match m1 = loc1.nearestVertex( QgsPoint( 2, 2 ), 999 );
QVERIFY( !m1.isValid() );

QgsRectangle bbox2( 0, 0, 1, 1 ); // in layer's bounds
QgsPointLocator loc2( mVL, 0 , &bbox2 );
QgsPointLocator loc2( mVL, 0, &bbox2 );

QgsPointLocator::Match m2 = loc2.nearestVertex( QgsPoint( 2, 2 ), 999 );
QVERIFY( m2.isValid() );

0 comments on commit a264a27

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