Skip to content

Commit edeafa9

Browse files
committedMay 3, 2015
indentation and minor sip updates
1 parent bae9cea commit edeafa9

16 files changed

+75
-71
lines changed
 

‎python/core/composer/qgscomposermap.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class QgsComposerMap : QgsComposerItem
182182
/**Called when atlas preview is toggled, to force map item to update its extent and redraw
183183
* @deprecated no longer required
184184
*/
185-
void toggleAtlasPreview();
185+
void toggleAtlasPreview() /Deprecated/;
186186

187187
/**Returns a pointer to the current map extent, which is either the original user specified
188188
* extent or the temporary atlas-driven feature extent depending on the current atlas state
@@ -620,7 +620,7 @@ class QgsComposerMap : QgsComposerItem
620620
/** Returns true if the extent is forced to center on the overview
621621
* @deprecated use overview()->centered() or overviews() instead
622622
*/
623-
bool overviewCentered() const;
623+
bool overviewCentered() const /Deprecated/;
624624

625625
/** Set the overview's centering mode
626626
* @deprecated use overview()->setCentered() or overviews() instead

‎python/core/qgsexpression.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class QgsExpression
8383

8484
double scale();
8585

86-
//! Return the expression string that was given when created.
86+
//! Alias for dump()
8787
const QString expression() const;
8888

8989
//! Return the expression string that represents this QgsExpression.

‎python/core/qgsfield.sip

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public:
4444
bool operator!=( const QgsField& other ) const;
4545

4646
//! Gets the name of the field
47-
const QString & name() const;
47+
const QString& name() const;
4848

4949
//! Gets variant type of the field as it will be retrieved from data source
5050
QVariant::Type type() const;
@@ -55,16 +55,14 @@ public:
5555
the data store reports it, with no attempt to standardize the value.
5656
@return QString containing the field type
5757
*/
58-
const QString & typeName() const;
59-
58+
const QString& typeName() const;
6059

6160
/**
6261
Gets the length of the field.
6362
@return int containing the length of the field
6463
*/
6564
int length() const;
6665

67-
6866
/**
6967
Gets the precision of the field. Not all field types have a related precision.
7068
@return int containing the precision or zero if not applicable to the field type.
@@ -74,7 +72,7 @@ public:
7472
/**
7573
Returns the field comment
7674
*/
77-
const QString & comment() const;
75+
const QString& comment() const;
7876

7977
/**
8078
Set the field name.
@@ -105,7 +103,6 @@ public:
105103
*/
106104
void setPrecision( int precision );
107105

108-
109106
/**
110107
Set the field comment
111108
*/
@@ -239,7 +236,7 @@ class QgsFields
239236
bool exists( int i ) const;
240237

241238
//! Get field at particular index (must be in range 0..N-1)
242-
// inline const QgsField& operator[]( int i ) const;
239+
// const QgsField& operator[]( int i ) const;
243240
QgsField& operator[](int i) /Factory/;
244241
%MethodCode
245242
SIP_SSIZE_T idx = sipConvertFromSequenceIndex(a0, sipCpp->count());

‎python/core/qgsstatisticalsummary.sip

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,23 @@ class QgsStatisticalSummary
2121
//! Enumeration of flags that specify statistics to be calculated
2222
enum Statistic
2323
{
24-
Count , //!< Count
25-
Sum, //!< Sum of values
26-
Mean, //!< Mean of values
27-
Median, //!< Median of values
28-
StDev, //!< Standard deviation of values
29-
StDevSample, //!< Sample standard deviation of values
30-
Min, //!< Min of values
31-
Max, //!< Max of values
32-
Range, //!< Range of values (max - min)
33-
Minority, //!< Minority of values
34-
Majority, //!< Majority of values
35-
Variety, //!< Variety (count of distinct) values
36-
FirstQuartile, //!< First quartile
37-
ThirdQuartile, //!< Third quartile
38-
InterQuartileRange, //!< Inter quartile range (IQR)
39-
All
24+
Count, //!< Count
25+
Sum, //!< Sum of values
26+
Mean, //!< Mean of values
27+
Median, //!< Median of values
28+
StDev, //!< Standard deviation of values
29+
StDevSample, //!< Sample standard deviation of values
30+
Min, //!< Min of values
31+
Max, //!< Max of values
32+
Range, //!< Range of values (max - min)
33+
Minority, //!< Minority of values
34+
Majority, //!< Majority of values
35+
Variety, //!< Variety (count of distinct) values
36+
FirstQuartile, //!< First quartile
37+
ThirdQuartile, //!< Third quartile
38+
InterQuartileRange, //!< Inter quartile range (IQR)
39+
All
4040
};
41-
4241
typedef QFlags<QgsStatisticalSummary::Statistic> Statistics;
4342

4443
/** Constructor for QgsStatisticalSummary
@@ -130,8 +129,8 @@ class QgsStatisticalSummary
130129
* @see minority
131130
*/
132131
double majority() const;
133-
134-
/** Returns the first quartile of the values. The quartile is calculated using the
132+
133+
/** Returns the first quartile of the values. The quartile is calculated using the
135134
* "Tukey's hinges" method.
136135
* @see thirdQuartile
137136
* @see interQuartileRange
@@ -156,4 +155,3 @@ class QgsStatisticalSummary
156155

157156
QFlags<QgsStatisticalSummary::Statistic> operator|(QgsStatisticalSummary::Statistic f1, QFlags<QgsStatisticalSummary::Statistic> f2);
158157

159-

‎python/core/qgsvectorlayer.sip

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ struct QgsVectorJoinInfo
8888
#include "qgsvectorlayer.h"
8989
%End
9090

91-
/**Join field in the target layer*/
91+
/** Join field in the target layer*/
9292
QString targetFieldName;
93-
/**Source layer*/
93+
/** Source layer*/
9494
QString joinLayerId;
95-
/**Join field in the source layer*/
95+
/** Join field in the source layer*/
9696
QString joinFieldName;
97-
/**True if the join is cached in virtual memory*/
97+
/** True if the join is cached in virtual memory*/
9898
bool memoryCache;
99-
/**Cache for joined attributes to provide fast lookup (size is 0 if no memory caching)
99+
/** Cache for joined attributes to provide fast lookup (size is 0 if no memory caching)
100100
@note not available in python bindings
101101
*/
102102
// QHash< QString, QgsAttributeMap> cachedAttributes;
@@ -1130,7 +1130,7 @@ class QgsVectorLayer : QgsMapLayer
11301130

11311131
/**Returns maximum value for an attribute column or invalid variant in case of error */
11321132
QVariant maximumValue( int index );
1133-
1133+
11341134
/** Fetches all values from a specified field name or expression.
11351135
* @param fieldOrExpression field name or an expression string
11361136
* @param ok will be set to false if field or expression is invalid, otherwise true
@@ -1139,7 +1139,7 @@ class QgsVectorLayer : QgsMapLayer
11391139
* @see getDoubleValues
11401140
*/
11411141
QList< QVariant > getValues( const QString &fieldOrExpression, bool &ok );
1142-
1142+
11431143
/** Fetches all double values from a specified field name or expression. Null values or
11441144
* invalid expression results are skipped.
11451145
* @param fieldOrExpression field name or an expression string evaluating to a double value

‎python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
8181
%TypeHeaderCode
8282
#include <qgsgraduatedsymbolrendererv2.h>
8383
%End
84-
8584
public:
85+
8686
QgsGraduatedSymbolRendererV2( QString attrName = QString(), QgsRangeList ranges = QgsRangeList() );
8787

8888
virtual ~QgsGraduatedSymbolRendererV2();
@@ -152,6 +152,7 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
152152
//! @param nclasses The number of classes to calculate (approximate for some modes)
153153
//! @note Added in 2.6
154154
void updateClasses( QgsVectorLayer *vlayer, Mode mode, int nclasses );
155+
155156
//! Evaluates the data expression and returns the list of values from the layer
156157
//! @param vlayer The layer for which to evaluate the expression
157158
//! @note Added in 2.6
@@ -180,7 +181,7 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2
180181
QgsSymbolV2* symbol /Transfer/,
181182
QgsVectorColorRampV2* ramp /Transfer/,
182183
bool inverted = false,
183-
QgsRendererRangeV2LabelFormat labelFormat=QgsRendererRangeV2LabelFormat()
184+
QgsRendererRangeV2LabelFormat legendFormat = QgsRendererRangeV2LabelFormat()
184185
);
185186

186187
//! create renderer from XML element

‎python/plugins/processing/algs/grass7/Grass7Algorithm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ def processAlgorithm(self, progress):
369369

370370
if self.grassName == 'r.horizon':
371371
command += out.name + uniqueSufix + '_0'
372-
elif self.grassName == 'r.composite':
372+
elif self.grassName == 'r.composite':
373373
commands.append(command)
374374
outputCommands.append(command)
375375
else:

‎python/plugins/processing/algs/qgis/Eliminate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def processAlgorithm(self, progress):
243243
# We have a candidate
244244
iGeom = geom2Eliminate.intersection(selGeom)
245245

246-
if iGeom == None:
246+
if iGeom is None:
247247
continue
248248

249249
if boundary:

‎src/core/qgspointlocator.cpp

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -634,11 +634,14 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )
634634
QgsRectangle rect = *mExtent;
635635
if ( mTransform )
636636
{
637-
try {
637+
try
638+
{
638639
rect = mTransform->transformBoundingBox( rect, QgsCoordinateTransform::ReverseTransform );
639-
} catch (const QgsException& e) {
640+
}
641+
catch ( const QgsException& e )
642+
{
640643
// See http://hub.qgis.org/issues/12634
641-
QgsDebugMsg( QString("could not transform bounding box to map, skipping the snap filter (%1)").arg(e.what()) );
644+
QgsDebugMsg( QString( "could not transform bounding box to map, skipping the snap filter (%1)" ).arg( e.what() ) );
642645
}
643646
}
644647
request.setFilterRect( rect );
@@ -652,11 +655,14 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )
652655

653656
if ( mTransform )
654657
{
655-
try {
658+
try
659+
{
656660
f.geometry()->transform( *mTransform );
657-
} catch (const QgsException& e) {
661+
}
662+
catch ( const QgsException& e )
663+
{
658664
// See http://hub.qgis.org/issues/12634
659-
QgsDebugMsg( QString("could not transform geometry to map, skipping the snap for it (%1)").arg(e.what()) );
665+
QgsDebugMsg( QString( "could not transform geometry to map, skipping the snap for it (%1)" ).arg( e.what() ) );
660666
continue;
661667
}
662668
}
@@ -724,11 +730,14 @@ void QgsPointLocator::onFeatureAdded( QgsFeatureId fid )
724730

725731
if ( mTransform )
726732
{
727-
try {
733+
try
734+
{
728735
f.geometry()->transform( *mTransform );
729-
} catch (const QgsException& e) {
736+
}
737+
catch ( const QgsException& e )
738+
{
730739
// See http://hub.qgis.org/issues/12634
731-
QgsDebugMsg( QString("could not transform geometry to map, skipping the snap for it (%1)").arg(e.what()) );
740+
QgsDebugMsg( QString( "could not transform geometry to map, skipping the snap for it (%1)" ).arg( e.what() ) );
732741
return;
733742
}
734743
}

‎src/core/qgsproviderregistry.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ QWidget* QgsProviderRegistry::selectWidget( const QString & providerKey,
408408

409409
#if QT_VERSION >= 0x050000
410410
QFunctionPointer QgsProviderRegistry::function( QString const & providerKey,
411-
QString const & functionName )
411+
QString const & functionName )
412412
{
413413
QLibrary myLib( library( providerKey ) );
414414

‎src/core/qgsstatisticalsummary.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class CORE_EXPORT QgsStatisticalSummary
3737
//! Enumeration of flags that specify statistics to be calculated
3838
enum Statistic
3939
{
40-
Count = 1, //!< Count
41-
Sum = 2, //!< Sum of values
40+
Count = 1, //!< Count
41+
Sum = 2, //!< Sum of values
4242
Mean = 4, //!< Mean of values
4343
Median = 8, //!< Median of values
4444
StDev = 16, //!< Standard deviation of values

‎src/core/symbology-ng/qgsgraduatedsymbolrendererv2.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ class CORE_EXPORT QgsGraduatedSymbolRendererV2 : public QgsFeatureRendererV2
269269
//! @note added in 2.10
270270
void setGraduatedMethod( GraduatedMethod method ) { mGraduatedMethod = method; }
271271

272-
273272
void setRotationField( QString fieldOrExpression ) override;
274273
QString rotationField() const override;
275274

‎src/gui/editorwidgets/qgsrelationreferencewidget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ void QgsRelationReferenceWidget::init()
535535
mComboBox->setCurrentIndex( mComboBox->findData( mFeature.id(), QgsAttributeTableModel::FeatureIdRole ) );
536536

537537
// Only connect after iterating, to have only one iterator on the referenced table at once
538-
connect( mComboBox, SIGNAL( currentIndexChanged(int) ), this, SLOT( comboReferenceChanged( int ) ) );
538+
connect( mComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( comboReferenceChanged( int ) ) );
539539
QApplication::restoreOverrideCursor();
540540
}
541541
}

‎src/gui/qgsuserinputtoolbar.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ void QgsUserInputToolBar::widgetDestroyed( QObject *obj )
7272
}
7373
}
7474

75-
void QgsUserInputToolBar::paintEvent(QPaintEvent * event)
75+
void QgsUserInputToolBar::paintEvent( QPaintEvent * event )
7676
{
77-
QToolBar::paintEvent(event);
77+
QToolBar::paintEvent( event );
7878
if ( mWidgetList.count() == 0 )
7979
{
8080
hide();

‎src/gui/qgsuserinputtoolbar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class GUI_EXPORT QgsUserInputToolBar : public QToolBar
3131
void addUserInputWidget( QWidget* widget );
3232

3333
protected:
34-
void paintEvent(QPaintEvent *event);
34+
void paintEvent( QPaintEvent *event );
3535

3636
private slots:
3737
void widgetDestroyed( QObject* obj );

‎tests/src/core/testqgsscaleexpression.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,44 +37,44 @@ class TestQgsScaleExpression: public QObject
3737
{
3838
{
3939
QgsScaleExpression exp( "scale_linear(column, 1, 7, 2, 10)" );
40-
QCOMPARE( bool(exp), true );
40+
QCOMPARE( bool( exp ), true );
4141
QCOMPARE( exp.type(), QgsScaleExpression::Linear );
42-
QCOMPARE( exp.baseExpression(), QString("column") );
42+
QCOMPARE( exp.baseExpression(), QString( "column" ) );
4343
QCOMPARE( exp.minValue(), 1. );
4444
QCOMPARE( exp.maxValue(), 7. );
4545
QCOMPARE( exp.minSize(), 2. );
4646
QCOMPARE( exp.maxSize(), 10. );
4747
}
4848
{
4949
QgsScaleExpression exp( "scale_exp(column, 1, 7, 2, 10, 0.5)" );
50-
QCOMPARE( bool(exp), true );
50+
QCOMPARE( bool( exp ), true );
5151
QCOMPARE( exp.type(), QgsScaleExpression::Area );
5252
}
5353
{
5454
QgsScaleExpression exp( "scale_exp(column, 1, 7, 2, 10, 0.57)" );
55-
QCOMPARE( bool(exp), true );
55+
QCOMPARE( bool( exp ), true );
5656
QCOMPARE( exp.type(), QgsScaleExpression::Flannery );
5757
}
5858
{
5959
QgsScaleExpression exp( "scale_exp(column, 1, 7, 2, 10, 0.51)" );
60-
QCOMPARE( bool(exp), false );
60+
QCOMPARE( bool( exp ), false );
6161
QCOMPARE( exp.type(), QgsScaleExpression::Unknown );
6262
}
6363
{
6464
QgsScaleExpression exp( "scale_exp(column, 1, 7, a, 10, 0.5)" );
65-
QCOMPARE( bool(exp), false );
65+
QCOMPARE( bool( exp ), false );
66+
QCOMPARE( exp.type(), QgsScaleExpression::Unknown );
67+
}
68+
{
69+
QgsScaleExpression exp( "scale_exp(column, 1, 7)" );
70+
QCOMPARE( bool( exp ), false );
6671
QCOMPARE( exp.type(), QgsScaleExpression::Unknown );
6772
}
68-
{
69-
QgsScaleExpression exp( "scale_exp(column, 1, 7)" );
70-
QCOMPARE( bool(exp), false );
71-
QCOMPARE( exp.type(), QgsScaleExpression::Unknown );
72-
}
7373
{
7474
QgsScaleExpression exp( QgsScaleExpression::Linear, "column", 1, 7, 2, 10 );
75-
QCOMPARE( bool(exp), true );
75+
QCOMPARE( bool( exp ), true );
7676
QCOMPARE( exp.type(), QgsScaleExpression::Linear );
77-
QCOMPARE( exp.baseExpression(), QString("column") );
77+
QCOMPARE( exp.baseExpression(), QString( "column" ) );
7878
QCOMPARE( exp.minValue(), 1. );
7979
QCOMPARE( exp.maxValue(), 7. );
8080
QCOMPARE( exp.minSize(), 2. );

0 commit comments

Comments
 (0)