Skip to content

Commit b6b08e9

Browse files
committed
Add 'accessor for' to doxygen compliance blacklist
Use "Returns the..." instead
1 parent 487a6a8 commit b6b08e9

12 files changed

+67
-29
lines changed

python/core/auto_generated/qgsscalecalculator.sip.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ Constructor
3333

3434
void setDpi( double dpi );
3535
%Docstring
36-
Set the dpi to be used in scale calculations
36+
Sets the ``dpi`` (dots per inch) for the output resolution, to be used in scale calculations.
3737

38-
:param dpi: Dots per inch of monitor resolution
38+
.. seealso:: :py:func:`dpi`
3939
%End
4040

4141
double dpi();
4242
%Docstring
43-
Accessor for dpi used in scale calculations
43+
Returns the DPI (dots per inch) used in scale calculations.
4444

45-
:return: int the dpi used for scale calculations.
45+
.. seealso:: :py:func:`setDpi`
4646
%End
4747

4848
void setMapUnits( QgsUnitTypes::DistanceUnit mapUnits );

python/core/auto_generated/qgsvectorlayer.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ Removes a vector layer join
437437

438438
QgsVectorLayerJoinBuffer *joinBuffer();
439439
%Docstring
440-
Accessor to the join buffer object
440+
Returns the join buffer object.
441441

442442
.. versionadded:: 2.14.7
443443
%End

python/core/auto_generated/raster/qgsrasterdataprovider.sip.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ to caller.
224224

225225
virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() );
226226
%Docstring
227-
Accessor for the raster layers pyramid list.
227+
Returns the raster layers pyramid list.
228228

229229
:param overviewList: used to construct the pyramid list (optional), when empty the list is defined by the provider.
230230
A pyramid list defines the

python/core/auto_generated/raster/qgsrasterlayer.sip.in

+10-6
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Set the data provider.
199199

200200
LayerType rasterType();
201201
%Docstring
202-
Accessor for raster layer type (which is a read only property)
202+
Returns the raster layer type (which is a read only property).
203203
%End
204204

205205
void setRenderer( QgsRasterRenderer *renderer /Transfer/ );
@@ -218,27 +218,31 @@ Sets raster resample filter. Takes ownership of the resample filter object
218218

219219
QgsRasterPipe *pipe();
220220
%Docstring
221-
Get raster pipe
221+
Returns the raster pipe.
222222
%End
223223

224224
int width() const;
225225
%Docstring
226-
Accessor that returns the width of the (unclipped) raster
226+
Returns the width of the (unclipped) raster.
227+
228+
.. seealso:: :py:func:`height`
227229
%End
228230

229231
int height() const;
230232
%Docstring
231-
Accessor that returns the height of the (unclipped) raster
233+
Returns the height of the (unclipped) raster.
234+
235+
.. seealso:: :py:func:`width`
232236
%End
233237

234238
int bandCount() const;
235239
%Docstring
236-
Get the number of bands in this layer
240+
Returns the number of bands in this layer.
237241
%End
238242

239243
QString bandName( int bandNoInt ) const;
240244
%Docstring
241-
Get the name of a band given its number
245+
Returns the name of a band given its number.
242246
%End
243247

244248
virtual QgsRasterDataProvider *dataProvider();

python/core/auto_generated/raster/qgsrastertransparency.sip.in

+11-2
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,19 @@ Constructor for QgsRasterTransparency.
4040
double percentTransparent;
4141
};
4242

43+
4344
QList<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleValuePixelList() const;
4445
%Docstring
45-
Accessor for transparentSingleValuePixelList
46+
Returns the transparent single value pixel list.
47+
48+
.. seealso:: :py:func:`setTransparentSingleValuePixelList`
4649
%End
4750

4851
QList<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValuePixelList() const;
4952
%Docstring
50-
Accessor for transparentThreeValuePixelList
53+
Returns the transparent three value pixel list.
54+
55+
.. seealso:: :py:func:`setTransparentThreeValuePixelList`
5156
%End
5257

5358
void initializeTransparentPixelList( double value );
@@ -63,11 +68,15 @@ Resets the transparency list to single red, green, and blue values.
6368
void setTransparentSingleValuePixelList( const QList<QgsRasterTransparency::TransparentSingleValuePixel> &newList );
6469
%Docstring
6570
Sets the transparent single value pixel list, replacing the whole existing list.
71+
72+
.. seealso:: :py:func:`transparentSingleValuePixelList`
6673
%End
6774

6875
void setTransparentThreeValuePixelList( const QList<QgsRasterTransparency::TransparentThreeValuePixel> &newList );
6976
%Docstring
7077
Sets the transparent three value pixel list, replacing the whole existing list.
78+
79+
.. seealso:: :py:func:`transparentThreeValuePixelList`
7180
%End
7281

7382
int alphaValue( double value, int globalTransparency = 255 ) const;

src/app/qgsprojectproperties.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class APP_EXPORT QgsProjectProperties : public QgsOptionsDialogBase, private Ui:
5858
QString title() const;
5959
void title( QString const &title );
6060

61-
//! Accessor for projection
61+
//! Returns the projection as a WKT string
6262
QString projectionWkt();
6363

6464
public slots:

src/core/qgsscalecalculator.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ class CORE_EXPORT QgsScaleCalculator
4444
QgsUnitTypes::DistanceUnit mapUnits = QgsUnitTypes::DistanceMeters );
4545

4646
/**
47-
* Set the dpi to be used in scale calculations
48-
* \param dpi Dots per inch of monitor resolution
47+
* Sets the \a dpi (dots per inch) for the output resolution, to be used in scale calculations.
48+
* \see dpi()
4949
*/
5050
void setDpi( double dpi );
5151

5252
/**
53-
* Accessor for dpi used in scale calculations
54-
* \returns int the dpi used for scale calculations.
53+
* Returns the DPI (dots per inch) used in scale calculations.
54+
* \see setDpi()
5555
*/
5656
double dpi();
5757

src/core/qgsvectorlayer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
504504
bool removeJoin( const QString &joinLayerId );
505505

506506
/**
507-
* Accessor to the join buffer object
507+
* Returns the join buffer object.
508508
* \since QGIS 2.14.7
509509
*/
510510
QgsVectorLayerJoinBuffer *joinBuffer() { return mJoinBuffer; }

src/core/raster/qgsrasterdataprovider.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
312312
}
313313

314314
/**
315-
* \brief Accessor for the raster layers pyramid list.
315+
* Returns the raster layers pyramid list.
316316
* \param overviewList used to construct the pyramid list (optional), when empty the list is defined by the provider.
317317
* A pyramid list defines the
318318
* POTENTIAL pyramids that can be in a raster. To know which of the pyramid layers

src/core/raster/qgsrasterlayer.h

+20-6
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,9 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
262262
*/
263263
void setDataProvider( const QString &provider, const QgsDataProvider::ProviderOptions &options );
264264

265-
//! \brief Accessor for raster layer type (which is a read only property)
265+
/**
266+
* Returns the raster layer type (which is a read only property).
267+
*/
266268
LayerType rasterType() { return mRasterType; }
267269

268270
//! Sets raster renderer. Takes ownership of the renderer object
@@ -275,19 +277,31 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
275277
QgsBrightnessContrastFilter *brightnessFilter() const { return mPipe.brightnessFilter(); }
276278
QgsHueSaturationFilter *hueSaturationFilter() const { return mPipe.hueSaturationFilter(); }
277279

278-
//! Get raster pipe
280+
/**
281+
* Returns the raster pipe.
282+
*/
279283
QgsRasterPipe *pipe() { return &mPipe; }
280284

281-
//! \brief Accessor that returns the width of the (unclipped) raster
285+
/**
286+
* Returns the width of the (unclipped) raster.
287+
* \see height()
288+
*/
282289
int width() const;
283290

284-
//! \brief Accessor that returns the height of the (unclipped) raster
291+
/**
292+
* Returns the height of the (unclipped) raster.
293+
* \see width()
294+
*/
285295
int height() const;
286296

287-
//! \brief Get the number of bands in this layer
297+
/**
298+
* Returns the number of bands in this layer.
299+
*/
288300
int bandCount() const;
289301

290-
//! \brief Get the name of a band given its number
302+
/**
303+
* Returns the name of a band given its number.
304+
*/
291305
QString bandName( int bandNoInt ) const;
292306

293307
// Returns nullptr if not using the data provider model (i.e. directly using GDAL)

src/core/raster/qgsrastertransparency.h

+11-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,17 @@ class CORE_EXPORT QgsRasterTransparency
6060
//
6161
// Initializer, Accessor and mutator for transparency tables.
6262
//
63-
//! \brief Accessor for transparentSingleValuePixelList
63+
64+
/**
65+
* Returns the transparent single value pixel list.
66+
* \see setTransparentSingleValuePixelList()
67+
*/
6468
QList<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleValuePixelList() const;
6569

66-
//! \brief Accessor for transparentThreeValuePixelList
70+
/**
71+
* Returns the transparent three value pixel list.
72+
* \see setTransparentThreeValuePixelList()
73+
*/
6774
QList<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValuePixelList() const;
6875

6976
/**
@@ -78,11 +85,13 @@ class CORE_EXPORT QgsRasterTransparency
7885

7986
/**
8087
* Sets the transparent single value pixel list, replacing the whole existing list.
88+
* \see transparentSingleValuePixelList()
8189
*/
8290
void setTransparentSingleValuePixelList( const QList<QgsRasterTransparency::TransparentSingleValuePixel> &newList );
8391

8492
/**
8593
* Sets the transparent three value pixel list, replacing the whole existing list.
94+
* \see transparentThreeValuePixelList()
8695
*/
8796
void setTransparentThreeValuePixelList( const QList<QgsRasterTransparency::TransparentThreeValuePixel> &newList );
8897

tests/code_layout/doxygen_parser.py

+2
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,8 @@ def memberDocIsNonCompliant(self, member_elem):
579579
return 'Use "Sets the..." instead of "setter"'
580580
elif para.text.strip().lower().startswith('mutator'):
581581
return 'Use "Sets the..." instead of "mutator for..."'
582+
elif para.text.strip().lower().startswith('accessor'):
583+
return 'Use "Returns the..." instead of "accessor for..."'
582584
elif para.text.strip().lower().startswith('return '):
583585
return 'Use "Returns the..." instead of "return ..."'
584586
#elif para.text.strip().lower().startswith('set '):

0 commit comments

Comments
 (0)