Skip to content

Commit

Permalink
indentation update
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Dec 30, 2014
1 parent e6561ce commit bff64fd
Show file tree
Hide file tree
Showing 66 changed files with 122 additions and 114 deletions.
4 changes: 2 additions & 2 deletions python/core/qgsdatadefined.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions python/plugins/db_manager/dlg_sql_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisappinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsadvanceddigitizingcanvasitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
2 changes: 1 addition & 1 deletion src/astyle/ASBeautifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 9 additions & 5 deletions src/core/qgsexpression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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 );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgslogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmapsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
34 changes: 19 additions & 15 deletions src/core/qgspallabeling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}
Expand Down Expand Up @@ -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 :)
Expand Down Expand Up @@ -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 );
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgssnapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmapcanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsmapcanvasitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmapcanvassnapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgis.g.info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion tests/src/analysis/testqgsvectoranalyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/analysis/testqgszonalstatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/app/testqgisappclipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/regression992.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgsatlascomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include <QtTest/QSignalSpy>
#include <QtTest/QtTest>

class TestQgsAtlasComposition: public QObject
class TestQgsAtlasComposition : public QObject
{
Q_OBJECT
private slots:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgsblendmodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerdd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerDD: public QObject
class TestQgsComposerDD : public QObject
{
Q_OBJECT
private slots:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposereffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <QColor>
#include <QPainter>

class TestQgsComposerEffects: public QObject
class TestQgsComposerEffects : public QObject
{
Q_OBJECT
private slots:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposergroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerGroup: public QObject
class TestQgsComposerGroup : public QObject
{
Q_OBJECT
private slots:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerhtml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerHtml: public QObject
class TestQgsComposerHtml : public QObject
{
Q_OBJECT
private slots:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposerlabel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerLabel: public QObject
class TestQgsComposerLabel : public QObject
{
Q_OBJECT
private slots:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposermap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <QObject>
#include <QtTest/QtTest>

class TestQgsComposerMap: public QObject
class TestQgsComposerMap : public QObject
{
Q_OBJECT
private slots:
Expand Down
2 changes: 1 addition & 1 deletion tests/src/core/testqgscomposermapgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <QObject>
#include <QtTest/QtTest>