Skip to content
Permalink
Browse files
indentation update
  • Loading branch information
jef-n committed Dec 30, 2014
1 parent e6561ce commit bff64fdef944e302c360778ca92db05d701682dc
Show file tree
Hide file tree
Showing 66 changed files with 122 additions and 114 deletions.
@@ -57,7 +57,7 @@ class QgsDataDefined

// @note not available in python bindings
//QMap< QString, QString > toMap();

/**Returns a DOM element containing the properties of the data defined container.
* @param DOM document
* @param elementName name for DOM element
@@ -75,7 +75,7 @@ class QgsDataDefined
* @see toXmlElement
*/
bool setFromXmlElement( const QDomElement& element );

bool operator==( const QgsDataDefined &other ) const;
bool operator!=( const QgsDataDefined &other ) const;

@@ -130,13 +130,13 @@ def clearSql(self):
self.editSql.setFocus()

def executeSql(self):

sql = ""
if self.editSql.hasSelectedText():
sql = self.editSql.selectedText()
else:
sql = self.editSql.text()

if sql == "":
return

@@ -153,7 +153,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
/** Returns and adjusted uri for the layer based on current and available CRS as well as the last selected image format
* @note added in 2.4
*/
QString crsAndFormatAdjustedLayerUri(const QString& uri, const QStringList& supportedCrs, const QStringList& supportedFormats) const;
QString crsAndFormatAdjustedLayerUri( const QString& uri, const QStringList& supportedCrs, const QStringList& supportedFormats ) const;

/** Add a 'pre-made' map layer to the project */
void addMapLayer( QgsMapLayer *theMapLayer );
@@ -66,7 +66,7 @@ QgisAppInterface::QgisAppInterface( QgisApp * _qgis )
connect( qgis, SIGNAL( projectRead() ),
this, SIGNAL( projectRead() ) );
connect( qgis, SIGNAL( layerSavedAs( QgsMapLayer*, QString ) ),
this, SIGNAL( layerSavedAs(QgsMapLayer*, QString ) ) );
this, SIGNAL( layerSavedAs( QgsMapLayer*, QString ) ) );
}

QgisAppInterface::~QgisAppInterface()
@@ -28,7 +28,7 @@ class QgsAdvancedDigitizingDockWidget;
class APP_EXPORT QgsAdvancedDigitizingCanvasItem : public QgsMapCanvasItem
{
public:
explicit QgsAdvancedDigitizingCanvasItem(QgsMapCanvas* canvas, QgsAdvancedDigitizingDockWidget* cadDockWidget );
explicit QgsAdvancedDigitizingCanvasItem( QgsMapCanvas* canvas, QgsAdvancedDigitizingDockWidget* cadDockWidget );

void paint( QPainter *painter );

@@ -636,7 +636,7 @@ string ASBeautifier::beautify(const string &originalLine)
{
string line;
bool isInLineComment = false;
bool lineStartsInComment = false;
bool lineStartsInComment;
bool isInClass = false;
bool isInSwitch = false;
bool isImmediatelyAfterConst = false;
@@ -1370,13 +1370,15 @@ static QVariant fcnIf( const QVariantList &values, const QgsFeature *f, QgsExpre
ENSURE_NO_EVAL_ERROR;
QVariant value = node->eval( parent, f );
ENSURE_NO_EVAL_ERROR;
if ( value.toBool() ) {
if ( value.toBool() )
{
node = getNode( values.at( 1 ), parent );
ENSURE_NO_EVAL_ERROR;
value = node->eval( parent, f );
ENSURE_NO_EVAL_ERROR;
}
else {
else
{
node = getNode( values.at( 2 ), parent );
ENSURE_NO_EVAL_ERROR;
value = node->eval( parent, f );
@@ -2565,15 +2567,17 @@ QVariant QgsExpression::NodeFunction::eval( QgsExpression* parent, const QgsFeat
foreach ( Node* n, mArgs->list() )
{
QVariant v;
if ( fd->lazyEval() ) {
if ( fd->lazyEval() )
{
// Pass in the node for the function to eval as it needs.
v = QVariant::fromValue( n );
}
else {
else
{
v = n->eval( parent, f );
ENSURE_NO_EVAL_ERROR;
if ( isNull( v ) && fd->name() != "coalesce" )
return QVariant(); // all "normal" functions return NULL, when any parameter is NULL (so coalesce is abnormal)
return QVariant(); // all "normal" functions return NULL, when any parameter is NULL (so coalesce is abnormal)
}
argValues.append( v );
}
@@ -26,7 +26,7 @@
#include "qgsconfig.h"

#ifndef CMAKE_SOURCE_DIR
#error CMAKE_SOURCE_DIR undefinied
#error CMAKE_SOURCE_DIR undefined
#endif // CMAKE_SOURCE_DIR

int QgsLogger::sDebugLevel = -999; // undefined value
@@ -166,7 +166,7 @@ void QgsMapSettings::updateDerived()
visibleExtent().center().y(),
outputSize().width(),
outputSize().height(),
mRotation);
mRotation );

#if 1 // set visible extent taking rotation in consideration
if ( mRotation )
@@ -4127,18 +4127,20 @@ void QgsPalLabeling::drawLabelCandidateRect( pal::LabelPosition* lp, QPainter* p
#if 1 // TODO: generalize some of this
double w = lp->getWidth();
double h = lp->getHeight();
double cx = lp->getX() + w/2.0;
double cy = lp->getY() + h/2.0;
double scale = 1.0/xform->mapUnitsPerPixel();
double cx = lp->getX() + w / 2.0;
double cy = lp->getY() + h / 2.0;
double scale = 1.0 / xform->mapUnitsPerPixel();
double rotation = xform->mapRotation();
double sw = w * scale;
double sh = h * scale;
QRectF rect( -sw/2, -sh/2, sw, sh );
QRectF rect( -sw / 2, -sh / 2, sw, sh );

painter->translate( xform->transform( QPointF(cx, cy) ).toQPointF() );
if ( rotation ) {
painter->translate( xform->transform( QPointF( cx, cy ) ).toQPointF() );
if ( rotation )
{
// Only if not horizontal
if ( lp->getFeaturePart()->getLayer()->getArrangement() != P_HORIZ ) {
if ( lp->getFeaturePart()->getLayer()->getArrangement() != P_HORIZ )
{
painter->rotate( rotation );
}
}
@@ -4204,7 +4206,7 @@ void QgsPalLabeling::drawLabel( pal::LabelPosition* label, QgsRenderContext& con
}

else if ( drawType == QgsPalLabeling::LabelBuffer
|| drawType == QgsPalLabeling::LabelText )
|| drawType == QgsPalLabeling::LabelText )
{

// TODO: optimize access :)
@@ -4290,17 +4292,19 @@ void QgsPalLabeling::drawLabel( pal::LabelPosition* label, QgsRenderContext& con
LabelPosition* lp = label;
double w = lp->getWidth();
double h = lp->getHeight();
double cx = lp->getX() + w/2.0;
double cy = lp->getY() + h/2.0;
double scale = 1.0/xform->mapUnitsPerPixel();
double cx = lp->getX() + w / 2.0;
double cy = lp->getY() + h / 2.0;
double scale = 1.0 / xform->mapUnitsPerPixel();
double rotation = xform->mapRotation();
double sw = w * scale;
double sh = h * scale;
QRectF rect( -sw/2, -sh/2, sw, sh );
painter->translate( xform->transform( QPointF(cx, cy) ).toQPointF() );
if ( rotation ) {
QRectF rect( -sw / 2, -sh / 2, sw, sh );
painter->translate( xform->transform( QPointF( cx, cy ) ).toQPointF() );
if ( rotation )
{
// Only if not horizontal
if ( lp->getFeaturePart()->getLayer()->getArrangement() != P_HORIZ ) {
if ( lp->getFeaturePart()->getLayer()->getArrangement() != P_HORIZ )
{
painter->rotate( rotation );
}
}
@@ -44,11 +44,11 @@ QgsSnapper::~QgsSnapper()
int QgsSnapper::snapPoint( const QPoint& startPoint, QList<QgsSnappingResult>& snappingResult, const QList<QgsPoint>& excludePoints )
{
QgsPoint mapCoordPoint = mMapSettings.mapToPixel().toMapCoordinates( startPoint.x(), startPoint.y() );
return snapPoint( mapCoordPoint, snappingResult, excludePoints);
return snapPoint( mapCoordPoint, snappingResult, excludePoints );
}

int QgsSnapper::snapPoint( const QgsPoint& mapCoordPoint, QList<QgsSnappingResult>& snappingResult, const QList<QgsPoint>& excludePoints )
{
{
snappingResult.clear();

QMultiMap<double, QgsSnappingResult> snappingResultList;//all snapping results
@@ -726,9 +726,9 @@ void QgsMapCanvas::rendererJobFinished()
// This is an hack to pass QgsMapCanvasItem::setRect what it
// expects (encoding of position and size of the item)
const QgsMapToPixel& m2p = mSettings.mapToPixel();
QgsPoint topLeft = m2p.toMapPoint(0,0);
QgsPoint topLeft = m2p.toMapPoint( 0, 0 );
double res = m2p.mapUnitsPerPixel();
QgsRectangle rect(topLeft.x(), topLeft.y(), topLeft.x() + img.width()*res, topLeft.y() - img.height()*res);
QgsRectangle rect( topLeft.x(), topLeft.y(), topLeft.x() + img.width()*res, topLeft.y() - img.height()*res );

mMap->setContent( img, rect );
}
@@ -83,10 +83,10 @@ void QgsMapCanvasItem::setRect( const QgsRectangle& rect )
{
// rect encodes origin of the item (xMin,yMax from map to canvas units)
// and size (rect size / map units per pixel)
r.setTopLeft( toCanvasCoordinates( QPointF(mRect.xMinimum(), mRect.yMaximum()) ) );
r.setTopLeft( toCanvasCoordinates( QPointF( mRect.xMinimum(), mRect.yMaximum() ) ) );
const QgsMapToPixel* m2p = mMapCanvas->getCoordinateTransform();
double res = m2p->mapUnitsPerPixel();
r.setSize( QSizeF(mRect.width()/res, mRect.height()/res) );
r.setSize( QSizeF( mRect.width() / res, mRect.height() / res ) );
}

// set position in canvas where the item will have coordinate (0,0)
@@ -117,7 +117,7 @@ int QgsMapCanvasSnapper::snapToCurrentLayer( const QPoint& p, QList<QgsSnappingR
int QgsMapCanvasSnapper::snapToBackgroundLayers( const QPoint& p, QList<QgsSnappingResult>& results, const QList<QgsPoint>& excludePoints )
{
const QgsPoint mapCoordPoint = mMapCanvas->mapSettings().mapToPixel().toMapCoordinates( p.x(), p.y() );
return snapToBackgroundLayers(mapCoordPoint,results,excludePoints);
return snapToBackgroundLayers( mapCoordPoint, results, excludePoints );
}

int QgsMapCanvasSnapper::snapToBackgroundLayers( const QgsPoint& point, QList<QgsSnappingResult>& results, const QList<QgsPoint>& excludePoints )
@@ -212,7 +212,7 @@ int main( int argc, char **argv )
G_get_cellhd( rast_opt->answer, "", &window );
G_set_window( &window );
fd = G_open_cell_old( rast_opt->answer, "" );
// wait for coors from stdin
// wait for coords from stdin
while ( fgets( buff, 100, stdin ) != 0 )
{
if ( sscanf( buff, "%lf%lf", &x, &y ) != 2 )
@@ -19,7 +19,7 @@ Email : sherman at mrcc dot com
#include <qgsapplication.h>
#include <qgsproviderregistry.h>

class TestQgsVectorAnalyzer: public QObject
class TestQgsVectorAnalyzer : public QObject
{
Q_OBJECT
private slots:
@@ -23,7 +23,7 @@
/** \ingroup UnitTests
* This is a unit test for the zonal statistics class
*/
class TestQgsZonalStatistics: public QObject
class TestQgsZonalStatistics : public QObject
{
Q_OBJECT
private slots:
@@ -33,7 +33,7 @@
/** \ingroup UnitTests
* This is a unit test for the QgisApp clipboard.
*/
class TestQgisAppClipboard: public QObject
class TestQgisAppClipboard : public QObject
{
Q_OBJECT
private slots:
@@ -40,7 +40,7 @@
/** \ingroup UnitTests
* This is a regression test for ticket #992.
*/
class Regression992: public QObject
class Regression992 : public QObject
{
Q_OBJECT
private slots:
@@ -33,7 +33,7 @@
#include <QtTest/QSignalSpy>
#include <QtTest/QtTest>

class TestQgsAtlasComposition: public QObject
class TestQgsAtlasComposition : public QObject
{
Q_OBJECT
private slots:
@@ -35,7 +35,7 @@
/** \ingroup UnitTests
* This is a unit test for layer blend modes
*/
class TestQgsBlendModes: public QObject
class TestQgsBlendModes : public QObject
{
Q_OBJECT
private slots:
@@ -32,7 +32,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerDD: public QObject
class TestQgsComposerDD : public QObject
{
Q_OBJECT
private slots:
@@ -25,7 +25,7 @@
#include <QColor>
#include <QPainter>

class TestQgsComposerEffects: public QObject
class TestQgsComposerEffects : public QObject
{
Q_OBJECT
private slots:
@@ -22,7 +22,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerGroup: public QObject
class TestQgsComposerGroup : public QObject
{
Q_OBJECT
private slots:
@@ -24,7 +24,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerHtml: public QObject
class TestQgsComposerHtml : public QObject
{
Q_OBJECT
private slots:
@@ -26,7 +26,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerLabel: public QObject
class TestQgsComposerLabel : public QObject
{
Q_OBJECT
private slots:
@@ -26,7 +26,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerMap: public QObject
class TestQgsComposerMap : public QObject
{
Q_OBJECT
private slots:
@@ -26,7 +26,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerMapGrid: public QObject
class TestQgsComposerMapGrid : public QObject
{
Q_OBJECT
private slots:
@@ -28,7 +28,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerMapOverview: public QObject
class TestQgsComposerMapOverview : public QObject
{
Q_OBJECT
private slots:
@@ -22,7 +22,7 @@
#include <QtTest/QtTest>
#include <QList>

class TestQgsComposerModel: public QObject
class TestQgsComposerModel : public QObject
{
Q_OBJECT

@@ -23,7 +23,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerMultiFrame: public QObject
class TestQgsComposerMultiFrame : public QObject
{
Q_OBJECT
private slots:

0 comments on commit bff64fd

Please sign in to comment.